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

Unified Diff: chrome/browser/extensions/extension_toolbar_model.h

Issue 700453003: Revert of Make extensions that desire to act pop out if in overflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d70a658f8062426519d2fe531696d2559e968ee1..950366e7768daa6bb3cbb5b9f9d845ef54b30d6e 100644
--- a/chrome/browser/extensions/extension_toolbar_model.h
+++ b/chrome/browser/extensions/extension_toolbar_model.h
@@ -41,17 +41,16 @@
// delegate.
class Observer {
public:
- // TODO(devlin): Rename these methods to be OnFoo.
- // Signals that an |extension| has been added to the toolbar at |index|.
+ // An extension has been added to the toolbar and should go at |index|.
virtual void ToolbarExtensionAdded(const Extension* extension,
int index) = 0;
- // Signals that the given |extension| has been removed from the toolbar.
+ // The given |extension| should be removed from the toolbar.
virtual void ToolbarExtensionRemoved(const Extension* extension) = 0;
- // Signals that the given |extension| has been moved to |index|. |index| is
- // the desired *final* index of the extension (that is, in the adjusted
- // order, extension should be at |index|).
+ // The given |extension| has been moved to |index|. |index| is the desired
+ // *final* index of the extension (that is, in the adjusted order, extension
+ // should be at |index|).
virtual void ToolbarExtensionMoved(const Extension* extension,
int index) = 0;
@@ -59,18 +58,18 @@
// updated.
virtual void ToolbarExtensionUpdated(const Extension* extension) = 0;
- // Signals the |extension| to show the popup now in the active window.
+ // Signal the |extension| to show the popup now in the active window.
// If |grant_active_tab| is true, then active tab permissions should be
// given to the extension (only do this if this is through a user action).
// Returns true if a popup was slated to be shown.
virtual bool ShowExtensionActionPopup(const Extension* extension,
bool grant_active_tab) = 0;
- // Signals when the container needs to be redrawn because of a size change,
+ // Signal when the container needs to be redrawn because of a size change,
// and when the model has finished loading.
virtual void ToolbarVisibleCountChanged() = 0;
- // Signals that the model has entered or exited highlighting mode, or that
+ // Signal that the model has entered or exited highlighting mode, or that
// the extensions being highlighted have (probably*) changed. Highlighting
// mode indicates that only a subset of the extensions are actively
// displayed, and those extensions should be highlighted for extra emphasis.
@@ -79,12 +78,6 @@
// with the new set (and just assume the new set is different).
virtual void ToolbarHighlightModeChanged(bool is_highlighting) = 0;
- // Signals that the toolbar needs to be reordered for the given
- // |web_contents|. This is caused by an overflowed action wanting to run,
- // and needing to "pop itself out".
- virtual void OnToolbarReorderNecessary(
- content::WebContents* web_contents) = 0;
-
// Returns the browser associated with the Observer.
virtual Browser* GetBrowser() = 0;
@@ -95,7 +88,7 @@
// Convenience function to get the ExtensionToolbarModel for a Profile.
static ExtensionToolbarModel* Get(Profile* profile);
- // Adds or removes an observer.
+ // Add or remove an observer.
void AddObserver(Observer* observer);
void RemoveObserver(Observer* observer);
@@ -105,14 +98,10 @@
// Sets the number of extension icons that should be visible.
// If count == size(), this will set the visible icon count to -1, meaning
// "show all actions".
- void SetVisibleIconCount(size_t count);
-
- size_t visible_icon_count() const {
- return visible_icon_count_ == -1 ?
- toolbar_items().size() : static_cast<size_t>(visible_icon_count_);
- }
-
- bool all_icons_visible() const { return visible_icon_count_ == -1; }
+ void SetVisibleIconCount(int count);
+
+ // As above, a return value of -1 represents "show all actions".
+ int GetVisibleIconCount() const { return visible_icon_count_; }
bool extensions_initialized() const { return extensions_initialized_; }
@@ -123,16 +112,6 @@
bool is_highlighting() const { return is_highlighting_; }
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.
- size_t 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
@@ -147,7 +126,7 @@
// the overflow bucket).
void EnsureVisibility(const ExtensionIdList& extension_ids);
- // Highlights the extensions specified by |extension_ids|. This will cause
+ // Highlight the extensions specified by |extension_ids|. This will cause
// the ToolbarModel to only display those extensions.
// Highlighting mode is only entered if there is at least one extension to
// be shown.
@@ -250,9 +229,7 @@
ExtensionIdList last_known_positions_;
// The number of icons visible (the rest should be hidden in the overflow
- // chevron). A value of -1 indicates that all icons should be visible.
- // TODO(devlin): Make a new variable to indicate that all icons should be
- // visible, instead of overloading this one.
+ // chevron).
int visible_icon_count_;
content::NotificationRegistrar registrar_;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698