fix: remove unused id argument from TranslateToStock() (#44912)

unused since fb537d91fc

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-12-02 08:36:48 -06:00 committed by GitHub
parent d7284f0262
commit d0668e6a3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,11 +101,10 @@ class GtkMessageBox : private NativeWindowObserver {
// Add buttons.
GtkDialog* dialog = GTK_DIALOG(dialog_);
if (settings.buttons.size() == 0) {
gtk_dialog_add_button(dialog, TranslateToStock(0, "OK"), 0);
gtk_dialog_add_button(dialog, TranslateToStock("OK"), 0);
} else {
for (size_t i = 0; i < settings.buttons.size(); ++i) {
gtk_dialog_add_button(dialog, TranslateToStock(i, settings.buttons[i]),
i);
gtk_dialog_add_button(dialog, TranslateToStock(settings.buttons[i]), i);
}
}
gtk_dialog_set_default_response(dialog, settings.default_id);
@ -146,16 +145,20 @@ class GtkMessageBox : private NativeWindowObserver {
}
}
const char* TranslateToStock(int id, const std::string& text) {
static const char* TranslateToStock(const std::string& text) {
const std::string lower = base::ToLowerASCII(text);
if (lower == "cancel")
if (lower == "cancel") {
return gtk_util::GetCancelLabel();
if (lower == "no")
}
if (lower == "no") {
return gtk_util::GetNoLabel();
if (lower == "ok")
}
if (lower == "ok") {
return gtk_util::GetOkLabel();
if (lower == "yes")
}
if (lower == "yes") {
return gtk_util::GetYesLabel();
}
return text.c_str();
}