Index: chrome/browser/views/browser_actions_container.h |
=================================================================== |
--- chrome/browser/views/browser_actions_container.h (revision 37026) |
+++ chrome/browser/views/browser_actions_container.h (working copy) |
@@ -8,6 +8,7 @@ |
#include <vector> |
#include "base/task.h" |
+#include "chrome/browser/extensions/extension_toolbar_model.h" |
#include "chrome/browser/extensions/image_loading_tracker.h" |
#include "chrome/browser/views/browser_bubble.h" |
#include "chrome/browser/views/extensions/extension_action_context_menu.h" |
@@ -215,7 +216,8 @@ |
public BrowserBubble::Delegate, |
public views::ViewMenuDelegate, |
public views::ResizeGripper::ResizeGripperDelegate, |
- public AnimationDelegate { |
+ public AnimationDelegate, |
+ public ExtensionToolbarModel::Observer { |
public: |
BrowserActionsContainer(Profile* profile, ToolbarView* toolbar); |
virtual ~BrowserActionsContainer(); |
@@ -295,14 +297,10 @@ |
ExtensionPopup* TestGetPopup() { return popup_; } |
private: |
- // Adds a browser action view for the extension if it needs one. DCHECK if |
- // it has already been added. |
- void AddBrowserAction(Extension* extension); |
+ // ExtensionToolbarModel::Observer implementation. |
+ virtual void BrowserActionAdded(Extension* extension, int index); |
+ virtual void BrowserActionRemoved(Extension* extension); |
- // Removes the browser action view for an extension if it has one. DCHECK if |
- // no such view. |
- void RemoveBrowserAction(Extension* extension); |
- |
// Takes a width in pixels, calculates how many icons fit within that space |
// (up to the maximum number of icons in our vector) and shaves off the |
// excess pixels. |
@@ -338,6 +336,9 @@ |
// from browser_action_views_). |
BrowserActionButton* popup_button_; |
+ // The model that tracks the order of the toolbar icons. |
+ ExtensionToolbarModel* model_; |
+ |
// The current size of the container. |
gfx::Size container_size_; |