summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-05 01:13:06 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-05 01:13:06 +0000
commita27d69a0f43bbad5fe7b0ed4ac55b24632b4143c (patch)
treea2a69aba2eae34b7083ab36722004d76cb630e04
parentb49a19e381316eeb528ff2e531c05113ec0e9cba (diff)
downloadchromium_src-a27d69a0f43bbad5fe7b0ed4ac55b24632b4143c.zip
chromium_src-a27d69a0f43bbad5fe7b0ed4ac55b24632b4143c.tar.gz
chromium_src-a27d69a0f43bbad5fe7b0ed4ac55b24632b4143c.tar.bz2
GTK: fix regression where MenuGtk::Delegate GetLabel() method was erroneously removed.
got overzealous deleting code in r35389 BUG=31391 TEST=see bug git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35502 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/gtk/menu_gtk.cc3
-rw-r--r--chrome/browser/gtk/menu_gtk.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/gtk/menu_gtk.cc b/chrome/browser/gtk/menu_gtk.cc
index 6437bb6..592d9d3 100644
--- a/chrome/browser/gtk/menu_gtk.cc
+++ b/chrome/browser/gtk/menu_gtk.cc
@@ -145,6 +145,9 @@ void MenuGtk::BuildMenuIn(GtkWidget* menu,
l10n_util::GetStringUTF16(menu_data->label_argument));
} else if (menu_data->label_id) {
label = l10n_util::GetStringUTF8(menu_data->label_id);
+ } else if (menu_data->type != MENU_SEPARATOR) {
+ label = delegate_->GetLabel(menu_data->id);
+ DCHECK(!label.empty());
}
label = ConvertAcceleratorsFromWindowsStyle(label);
diff --git a/chrome/browser/gtk/menu_gtk.h b/chrome/browser/gtk/menu_gtk.h
index e68759f..2438e4e 100644
--- a/chrome/browser/gtk/menu_gtk.h
+++ b/chrome/browser/gtk/menu_gtk.h
@@ -34,6 +34,9 @@ class MenuGtk {
// Returns whether this command is checked (for checkbox menu items only).
virtual bool IsItemChecked(int command_id) const { return false; }
+ // Gets the label. Only needs to be implemented for custom (dynamic) labels.
+ virtual std::string GetLabel(int command_id) const { return std::string(); }
+
// Executes the command.
virtual void ExecuteCommand(int command_id) {}