summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/menu_gtk.h
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 23:51:20 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 23:51:20 +0000
commit14831ef6c6fb54bd7aafa1006c5a2650ee6e9097 (patch)
tree7fb7b566271922e09a25997488b2d9137d50a051 /chrome/browser/gtk/menu_gtk.h
parent755fd4806a674e254387e3053857b5475453c8b8 (diff)
downloadchromium_src-14831ef6c6fb54bd7aafa1006c5a2650ee6e9097.zip
chromium_src-14831ef6c6fb54bd7aafa1006c5a2650ee6e9097.tar.gz
chromium_src-14831ef6c6fb54bd7aafa1006c5a2650ee6e9097.tar.bz2
Re-organize RenderViewContextMenu to the use cross-platform MenuModel class.
Benefits: - less code - more straightforward code - more shared code unresolved issues: - RenderViewContextMenu{Gtk,Mac,Views} should not be a subclass of RenderViewContextMenu - On Linux, IMEs are added in the wrong place (not near the other editable stuff) BUG=31365 TEST=manual + trybots Review URL: http://codereview.chromium.org/2017001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46987 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/menu_gtk.h')
-rw-r--r--chrome/browser/gtk/menu_gtk.h26
1 files changed, 1 insertions, 25 deletions
diff --git a/chrome/browser/gtk/menu_gtk.h b/chrome/browser/gtk/menu_gtk.h
index ed5342e..781b61d 100644
--- a/chrome/browser/gtk/menu_gtk.h
+++ b/chrome/browser/gtk/menu_gtk.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -19,8 +19,6 @@ namespace menus {
class MenuModel;
}
-struct MenuCreateMaterial;
-
class MenuGtk {
public:
// Delegate class that lets another class control the status of the menu.
@@ -28,18 +26,6 @@ class MenuGtk {
public:
virtual ~Delegate() { }
- // Returns whether the menu item for this command should be enabled.
- virtual bool IsCommandEnabled(int command_id) const { return false; }
-
- // 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 ExecuteCommandById(int command_id) {}
-
// Called before a command is executed. This exists for the case where a
// model is handling the actual execution of commands, but the delegate
// still needs to know that some command got executed. This is called before
@@ -57,11 +43,6 @@ class MenuGtk {
virtual bool AlwaysShowImages() const { return false; }
};
- // Builds a MenuGtk that uses |delegate| to perform actions and |menu_data|
- // to create the menu.
- MenuGtk(MenuGtk::Delegate* delegate, const MenuCreateMaterial* menu_data);
- // Creates a MenuGtk that uses |delegate| to perform actions. Builds the
- // menu using |model_|.
MenuGtk(MenuGtk::Delegate* delegate, menus::MenuModel* model);
~MenuGtk();
@@ -125,11 +106,6 @@ class MenuGtk {
GtkWidget* widget() const { return menu_; }
private:
- // A recursive function that transforms a MenuCreateMaterial tree into a set
- // of GtkMenuItems.
- void BuildMenuIn(GtkWidget* menu,
- const MenuCreateMaterial* menu_data);
-
// Builds a GtkImageMenuItem.
GtkWidget* BuildMenuItemWithImage(const std::string& label,
const SkBitmap& icon);