diff options
author | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 21:50:01 +0000 |
---|---|---|
committer | andybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-18 21:50:01 +0000 |
commit | fc9510c4bc745af79827216ca015ef3dd1607f62 (patch) | |
tree | 57ae230852bb52dcd76a3aeefe96db86aa5fe690 /chrome/browser/cocoa/extensions/browser_actions_controller.h | |
parent | 6d9e355a4421e37895a8492ab300cf918a8e1334 (diff) | |
download | chromium_src-fc9510c4bc745af79827216ca015ef3dd1607f62.zip chromium_src-fc9510c4bc745af79827216ca015ef3dd1607f62.tar.gz chromium_src-fc9510c4bc745af79827216ca015ef3dd1607f62.tar.bz2 |
[Mac] Implement a basic overflow menu for hidden Browser Action buttons.
Known issues:
o The ordering of the Browser Actions is not consistent within the menu.
o Icons for the actions within the menu are not implemented yet.
o It is a standard NSMenu, so drag and drop will not work and right click does not work for now.
TEST=none
BUG=32101
Review URL: http://codereview.chromium.org/1083001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42000 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 | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/extensions/browser_actions_controller.h b/chrome/browser/cocoa/extensions/browser_actions_controller.h index cd39283..758b666 100644 --- a/chrome/browser/cocoa/extensions/browser_actions_controller.h +++ b/chrome/browser/cocoa/extensions/browser_actions_controller.h @@ -17,6 +17,7 @@ class Extension; @class ExtensionPopupController; class ExtensionToolbarModel; class ExtensionsServiceObserverBridge; +@class MenuButton; class PrefService; class Profile; @@ -52,6 +53,15 @@ 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 chevron button used when Browser Actions are hidden. + scoped_nsobject<MenuButton> chevronMenuButton_; + + // The Browser Actions overflow menu. + scoped_nsobject<NSMenu> overflowMenu_; } @property(readonly, nonatomic) BrowserActionsContainerView* containerView; @@ -72,13 +82,13 @@ extern const NSString* kBrowserActionVisibilityChangedNotification; // container. - (NSUInteger)visibleButtonCount; +// 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; -// Executes the action designated by the extension. -- (void)browserActionClicked:(BrowserActionButton*)sender; - // Returns the NSView for the action button associated with an extension. - (NSView*)browserActionViewForExtension:(Extension*)extension; @@ -87,6 +97,19 @@ extern const NSString* kBrowserActionVisibilityChangedNotification; // set. - (CGFloat)savedWidth; +// Returns where the popup arrow should point to for a given Browser Action. If +// it is passed an extension that is not a Browser Action, then it will return +// NSZeroPoint. +- (NSPoint)popupPointForBrowserAction:(Extension*)extension; + +// Returns whether the chevron button is currently hidden or in the process of +// being hidden (fading out). Will return NO if it is not hidden or is in the +// 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; |