Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1278)

Unified Diff: chrome/browser/ui/toolbar/action_box_menu_model.h

Issue 10887029: Only show chrome2mobile in action box if it is enabled (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/toolbar/action_box_menu_model.h
diff --git a/chrome/browser/ui/toolbar/action_box_menu_model.h b/chrome/browser/ui/toolbar/action_box_menu_model.h
index 8096e8701fb66b2ea7dca1a3444baece31f9524a..abb3ff3e218c3343efdd5c9981f4f8bea844404b 100644
--- a/chrome/browser/ui/toolbar/action_box_menu_model.h
+++ b/chrome/browser/ui/toolbar/action_box_menu_model.h
@@ -8,11 +8,14 @@
#include <map>
#include "content/public/browser/notification_observer.h"
+#include "chrome/browser/command_observer.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/ui/browser_commands.h"
#include "ui/base/models/simple_menu_model.h"
class Browser;
+class CommandUpdater;
+class Profile;
namespace extensions {
class Extension;
@@ -23,10 +26,12 @@ class Extension;
// at creation time.
class ActionBoxMenuModel : public ui::SimpleMenuModel,
public ui::SimpleMenuModel::Delegate,
- public content::NotificationObserver {
+ public content::NotificationObserver,
+ public CommandObserver {
public:
ActionBoxMenuModel(Browser* browser,
- ExtensionService* extension_service);
+ ExtensionService* extension_service,
+ CommandUpdater* command_updater);
virtual ~ActionBoxMenuModel();
// Returns true if item associated with an extension.
@@ -56,8 +61,14 @@ class ActionBoxMenuModel : public ui::SimpleMenuModel,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
+ // CommandObserver:
+ virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE;
+
+ void UpdateMenu();
+
Browser* browser_;
ExtensionService* extension_service_;
+ CommandUpdater* command_updater_;
IdToEntensionIdMap id_to_extension_id_map_;

Powered by Google App Engine
This is Rietveld 408576698