Index: chrome/browser/extensions/extension_toolbar_model.h |
diff --git a/chrome/browser/extensions/extension_toolbar_model.h b/chrome/browser/extensions/extension_toolbar_model.h |
index 950366e7768daa6bb3cbb5b9f9d845ef54b30d6e..088171bd0818fc382540ef6bf184cb2b5d39134e 100644 |
--- a/chrome/browser/extensions/extension_toolbar_model.h |
+++ b/chrome/browser/extensions/extension_toolbar_model.h |
@@ -78,6 +78,12 @@ class ExtensionToolbarModel : public content::NotificationObserver, |
// with the new set (and just assume the new set is different). |
virtual void ToolbarHighlightModeChanged(bool is_highlighting) = 0; |
+ // Signal that the toolbar needs to be reordered for the given |
Peter Kasting
2014/10/30 22:05:59
Nit: "Signals" (see http://google-styleguide.googl
Devlin
2014/10/31 17:44:09
Yeah, this and the name itself were to match exist
|
+ // |web_contents|. This is caused by an overflowed action wanting to run, |
+ // and needing to "pop itself out". |
+ virtual void ToolbarReorderNecessary( |
Peter Kasting
2014/10/30 22:05:59
Nit: This is a strange name for a function. It so
Devlin
2014/10/31 17:44:09
/sigh... I know - it's bothered me most times I ad
Peter Kasting
2014/10/31 19:01:07
Doesn't bother me. Bonus points if you go write a
|
+ content::WebContents* web_contents) = 0; |
+ |
// Returns the browser associated with the Observer. |
virtual Browser* GetBrowser() = 0; |
@@ -103,6 +109,12 @@ class ExtensionToolbarModel : public content::NotificationObserver, |
// As above, a return value of -1 represents "show all actions". |
int GetVisibleIconCount() const { return visible_icon_count_; } |
+ // Returns the number of visible icons as an absolute value. |
Peter Kasting
2014/10/30 22:05:59
Nit: I think this name/comment are misleading. Th
Devlin
2014/10/31 17:44:09
Yeah, I struggled with the name. The problem with
Peter Kasting
2014/10/31 19:01:07
Good resolution. I'm happy with it.
|
+ size_t GetAbsoluteVisibleIconCount() const { |
+ return visible_icon_count_ == -1 ? |
+ toolbar_items().size() : static_cast<size_t>(visible_icon_count_); |
+ } |
+ |
bool extensions_initialized() const { return extensions_initialized_; } |
const ExtensionList& toolbar_items() const { |
@@ -113,6 +125,17 @@ class ExtensionToolbarModel : public content::NotificationObserver, |
void OnExtensionToolbarPrefChange(); |
+ // Returns the item order for a given tab. This can be different from the |
+ // base item order if the action wants to run on the given page, and needs to |
+ // be popped out of overflow. |
+ ExtensionList GetItemOrderForTab(content::WebContents* web_contents) const; |
+ |
+ // Returns the visible icon count for a given tab. This can be different from |
+ // the base item order if the action wants to run on the given page and needs |
+ // to be popped out of overflow. |
+ // A result of -1 indicates "all icons". |
+ int GetVisibleIconCountForTab(content::WebContents* web_contents) const; |
+ |
// Finds the Observer associated with |browser| and tells it to display a |
// popup for the given |extension|. If |grant_active_tab| is true, this |
// grants active tab permissions to the |extension|; only do this because of |