diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:38:25 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-24 19:38:25 +0000 |
commit | f4967c63a0dcccae47b1584e454fec1dc2b18019 (patch) | |
tree | 224dddcf85cdd44721cad7287b3015cf58978e28 /chrome/browser/cocoa/extensions/browser_actions_controller.h | |
parent | 2451f831e8bbfca6bb63c2ce610bfd2ed5c50c2e (diff) | |
download | chromium_src-f4967c63a0dcccae47b1584e454fec1dc2b18019.zip chromium_src-f4967c63a0dcccae47b1584e454fec1dc2b18019.tar.gz chromium_src-f4967c63a0dcccae47b1584e454fec1dc2b18019.tar.bz2 |
[Mac] Finish up the resizing code for the Browser Actions container complete with animations and all. Also added basic skeleton unit test for container.
Polish bugs to be filed:
o Resizing the container is not synced across windows.
o Buttons do not animate in/out when added/removed.
TEST=none
BUG=32101
Review URL: http://codereview.chromium.org/1198001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/extensions/browser_actions_controller.h')
-rw-r--r-- | chrome/browser/cocoa/extensions/browser_actions_controller.h | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.h b/chrome/browser/cocoa/extensions/browser_actions_controller.h index 758b666..53ebb8b 100644 --- a/chrome/browser/cocoa/extensions/browser_actions_controller.h +++ b/chrome/browser/cocoa/extensions/browser_actions_controller.h @@ -43,6 +43,10 @@ extern const NSString* kBrowserActionVisibilityChangedNotification; // The model that tracks the order of the toolbar icons. Weak. ExtensionToolbarModel* toolbarModel_; + // The frame to be used for the container when updating the chevron position + // during animation. + NSRect animationContainerEndFrame_; + // The observer for the ExtensionsService we're getting events from. scoped_ptr<ExtensionsServiceObserverBridge> observer_; @@ -54,8 +58,8 @@ extern const NSString* kBrowserActionVisibilityChangedNotification; // Array of hidden buttons in the correct order in which the user specified. scoped_nsobject<NSMutableArray> hiddenButtons_; - // The currently running animation. - scoped_nsobject<NSAnimation> animation_; + // The currently running chevron animation (fade in/out). + scoped_nsobject<NSAnimation> chevronAnimation_; // The chevron button used when Browser Actions are hidden. scoped_nsobject<MenuButton> chevronMenuButton_; @@ -85,16 +89,16 @@ extern const NSString* kBrowserActionVisibilityChangedNotification; // Returns a pointer to the chevron menu button. - (MenuButton*)chevronMenuButton; -// Resizes the container to fit all the visible buttons and other elements -// (grippy and overflow button). -- (void)resizeContainerWithAnimation:(BOOL)animate; +// Resizes the container given the number of visible buttons, taking into +// account the size of the grippy. Also updates the persistent width preference. +- (void)resizeContainerAndAnimate:(BOOL)animate; // Returns the NSView for the action button associated with an extension. - (NSView*)browserActionViewForExtension:(Extension*)extension; -// Returns the saved width preference as specified by the user. If none is -// specified, then zero is returned, indicating that the width has never been -// set. +// Returns the saved width determined by the number of shown Browser Actions +// preference property. If no preference is found, then the width for the +// container is returned as if all buttons are shown. - (CGFloat)savedWidth; // Returns where the popup arrow should point to for a given Browser Action. If @@ -107,9 +111,6 @@ extern const NSString* kBrowserActionVisibilityChangedNotification; // process of fading in. - (BOOL)chevronIsHidden; -// Sets whether to show the chevron button. -- (void)setChevronHidden:(BOOL)hidden animate:(BOOL)animate; - // Registers the user preferences used by this class. + (void)registerUserPrefs:(PrefService*)prefs; |