diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 01:13:37 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-17 01:13:37 +0000 |
commit | fee8f0222a5f2a377ba5d7f2d3383481c02eafac (patch) | |
tree | 0542f26a1076b07d0857298b7a9fc694a61422cb /chrome/browser/extensions/extension_toolbar_model.h | |
parent | 8fa18a33d2dee21f748139ef503d08ebb4b706af (diff) | |
download | chromium_src-fee8f0222a5f2a377ba5d7f2d3383481c02eafac.zip chromium_src-fee8f0222a5f2a377ba5d7f2d3383481c02eafac.tar.gz chromium_src-fee8f0222a5f2a377ba5d7f2d3383481c02eafac.tar.bz2 |
Add a pref for the number of showing icons in the browser actions toolbar.
Also fix some issues on GTK concerning the proper behavior when adding/removing browser actions (container sizing + chevron visibility).
Windows uses a different pref (kBrowserActionContainerWidth), which is measured in pixels; it should be migrated to the new pref.
Also, register extension prefs during startup.
BUG=32101
TEST=manual
Review URL: http://codereview.chromium.org/841007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41800 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_toolbar_model.h')
-rw-r--r-- | chrome/browser/extensions/extension_toolbar_model.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_toolbar_model.h b/chrome/browser/extensions/extension_toolbar_model.h index 2341493b5..44f7950 100644 --- a/chrome/browser/extensions/extension_toolbar_model.h +++ b/chrome/browser/extensions/extension_toolbar_model.h @@ -11,6 +11,7 @@ #include "chrome/common/notification_registrar.h" class ExtensionsService; +class PrefService; // Model for the browser actions toolbar. class ExtensionToolbarModel : public NotificationObserver { @@ -37,9 +38,11 @@ class ExtensionToolbarModel : public NotificationObserver { void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); void MoveBrowserAction(Extension* extension, int index); - // TODO(estade): implement these. - void SetVisibleIconCount(int count) {} - int GetVisibleIconCount() { return -1; } + // If count == size(), this will set the visible icon count to -1, meaning + // "show all actions". + void SetVisibleIconCount(int count); + // As above, a return value of -1 represents "show all actions". + int GetVisibleIconCount() { return visible_icon_count_; } size_t size() const { return toolitems_.size(); @@ -83,6 +86,8 @@ class ExtensionToolbarModel : public NotificationObserver { // Our ExtensionsService, guaranteed to outlive us. ExtensionsService* service_; + PrefService* prefs_; + // Ordered list of browser action buttons. ExtensionList toolitems_; @@ -92,6 +97,10 @@ class ExtensionToolbarModel : public NotificationObserver { // Keeps track of where the last extension to get disabled was in the list. size_t last_extension_removed_index_; + // The number of icons visible (the rest should be hidden in the overflow + // chevron). + int visible_icon_count_; + NotificationRegistrar registrar_; }; |