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

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

Issue 12095023: Allow platform apps to add themselves to the Action Box. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Use raw pointer + IconImage signature changed Created 7 years, 10 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_button_controller.h
diff --git a/chrome/browser/ui/toolbar/action_box_button_controller.h b/chrome/browser/ui/toolbar/action_box_button_controller.h
index 45c56928f63afcbe1c648200a9d16b08762bb0bb..e43529ed8dfdfa14d72b08b3afaf6ddea6c5f2ad 100644
--- a/chrome/browser/ui/toolbar/action_box_button_controller.h
+++ b/chrome/browser/ui/toolbar/action_box_button_controller.h
@@ -9,11 +9,11 @@
#include <string>
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/ui/toolbar/action_box_menu_model.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "ui/base/models/simple_menu_model.h"
+class ActionBoxMenuModel;
class Browser;
namespace extensions {
@@ -35,7 +35,7 @@ class ActionBoxButtonController : public ui::SimpleMenuModel::Delegate,
class Delegate {
public:
// Shows the menu with the given |menu_model|.
- virtual void ShowMenu(scoped_ptr<ActionBoxMenuModel> menu_model) {}
+ virtual void ShowMenu(scoped_ptr<ActionBoxMenuModel> menu_model);
protected:
virtual ~Delegate() {}
@@ -60,8 +60,8 @@ class ActionBoxButtonController : public ui::SimpleMenuModel::Delegate,
// Gets the command ID for an extension, creating a new one if necessary.
int GetCommandIdForExtension(const extensions::Extension& extension);
- // Gets the extension for a command ID, or NULL if there isn't one.
- const extensions::Extension* GetExtensionForCommandId(int command_id);
+ // Returns the next command ID to be used.
+ int GetNextCommandId();
// content::NotificationObserver implementation.
virtual void Observe(int type,
@@ -72,13 +72,12 @@ class ActionBoxButtonController : public ui::SimpleMenuModel::Delegate,
Delegate* delegate_;
- // The command ID to assign to the next extension that needs one.
- int next_extension_command_id_;
-
- // The extension IDs that have commands associated with them.
- typedef std::map<std::string, int> ExtensionIdCommandMap;
+ typedef std::map<int, std::string> ExtensionIdCommandMap;
ExtensionIdCommandMap extension_command_ids_;
+ // The command ID to assign to the next dynamic entry that needs one.
+ int next_command_id_;
+
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(ActionBoxButtonController);
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/plus_decoration.mm ('k') | chrome/browser/ui/toolbar/action_box_button_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698