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/extension_installed_bubble_controller.mm | |
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/extension_installed_bubble_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/extension_installed_bubble_controller.mm | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/chrome/browser/cocoa/extension_installed_bubble_controller.mm b/chrome/browser/cocoa/extension_installed_bubble_controller.mm index f65b455..fac8384 100644 --- a/chrome/browser/cocoa/extension_installed_bubble_controller.mm +++ b/chrome/browser/cocoa/extension_installed_bubble_controller.mm @@ -166,25 +166,10 @@ class ExtensionLoadedNotificationObserver : public NotificationObserver { switch(type_) { case extension_installed_bubble::kBrowserAction: { - // Find the center of the bottom of the browser action icon. - NSView* button = [[[window->cocoa_controller() toolbarController] - browserActionsController] browserActionViewForExtension:extension_]; - DCHECK(button); - NSRect boundsRect = [[button superview] convertRect:[button frame] - toView:nil]; - CGFloat xPos = NSMidX(boundsRect); - // If the button is hidden, display the button at the edge of the Browser - // Actions container. - // TODO(andybons): Make it point to the chevron once it's implemented. - if ([button alphaValue] == 0.0) { - NSView* superview = [button superview]; - NSRect superviewRect = - [[superview superview] convertRect:[superview frame] - toView:nil]; - xPos = NSMaxX(superviewRect); - } - - arrowPoint = NSMakePoint(xPos, NSMinY(boundsRect)); + BrowserActionsController* controller = + [[window->cocoa_controller() toolbarController] + browserActionsController]; + arrowPoint = [controller popupPointForBrowserAction:extension_]; break; } case extension_installed_bubble::kPageAction: { |