From d0668e6a3ac0c4bb490d8cb10c269be38df8de66 Mon Sep 17 00:00:00 2001 From: "trop[bot]" <37223003+trop[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 08:36:48 -0600 Subject: [PATCH] fix: remove unused id argument from TranslateToStock() (#44912) unused since fb537d91fce3f97ac3b902c36fcc4626eef0c959 Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Charles Kerr --- shell/browser/ui/message_box_gtk.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/shell/browser/ui/message_box_gtk.cc b/shell/browser/ui/message_box_gtk.cc index 338975d6d66..2f2a5275a9b 100644 --- a/shell/browser/ui/message_box_gtk.cc +++ b/shell/browser/ui/message_box_gtk.cc @@ -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(); }