summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/browser_actions_container.h
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 21:44:45 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 21:44:45 +0000
commit7d9ad0b30c0775a7345e965294c9f86bb0d543e5 (patch)
tree8b5d69fbff00af703b0d330ffe5ca719db9696e5 /chrome/browser/views/browser_actions_container.h
parent60050d0da7ca869e9c5ffe887cc2c51bc4b51deb (diff)
downloadchromium_src-7d9ad0b30c0775a7345e965294c9f86bb0d543e5.zip
chromium_src-7d9ad0b30c0775a7345e965294c9f86bb0d543e5.tar.gz
chromium_src-7d9ad0b30c0775a7345e965294c9f86bb0d543e5.tar.bz2
Browser Action Container should not shrink when visible extension is disabled.
We now calculate the visible actions before removing them from the vector so we can maintain the same number after deletion occurs. Also added unit tests and fixed a bug in GetTooltip where we were hard-coding the index to be 0. BUG=35349 TEST=Covered by new unit test. Review URL: http://codereview.chromium.org/606008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38959 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/browser_actions_container.h')
-rw-r--r--chrome/browser/views/browser_actions_container.h17
1 files changed, 15 insertions, 2 deletions
diff --git a/chrome/browser/views/browser_actions_container.h b/chrome/browser/views/browser_actions_container.h
index 1ace12d..5df29f1 100644
--- a/chrome/browser/views/browser_actions_container.h
+++ b/chrome/browser/views/browser_actions_container.h
@@ -9,6 +9,7 @@
#include <string>
#include <vector>
+#include "app/slide_animation.h"
#include "base/task.h"
#include "chrome/browser/extensions/extension_toolbar_model.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
@@ -31,7 +32,6 @@ class ExtensionAction;
class ExtensionPopup;
class PrefService;
class Profile;
-class SlideAnimation;
////////////////////////////////////////////////////////////////////////////////
// BrowserActionButton
@@ -353,6 +353,15 @@ class BrowserActionsContainer
// Retrieve the current popup. This should only be used by unit tests.
ExtensionPopup* TestGetPopup() { return popup_; }
+ // Set how many icons the container should show. This should only be used by
+ // unit tests.
+ void TestSetIconVisibilityCount(size_t icons);
+
+ // During testing we can disable animations by setting this flag to true,
+ // so that the bar resizes instantly, instead of having to poll it while it
+ // animates to open/closed status.
+ static bool disable_animations_during_testing_;
+
private:
typedef std::vector<BrowserActionView*> BrowserActionViews;
@@ -399,6 +408,10 @@ class BrowserActionsContainer
// all the padding that we normally show if there are icons.
int ContainerMinSize() const;
+ // Animate to the target value (unless testing, in which case we go straight
+ // to the target size).
+ void Animate(SlideAnimation::TweenType tween_type);
+
// Returns true if this extension should be shown in this toolbar. This can
// return false if we are in an incognito window and the extension is disabled
// for incognito.
@@ -413,7 +426,7 @@ class BrowserActionsContainer
Profile* profile_;
- // The Browser object the containier is associated with.
+ // The Browser object the container is associated with.
Browser* browser_;
// The view that owns us.