diff options
author | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 13:33:44 +0000 |
---|---|---|
committer | skerner@chromium.org <skerner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-23 13:33:44 +0000 |
commit | 86f44680f8b6d9dcfb14ad9944c0da5c0832da15 (patch) | |
tree | 9e974a0efb70fd16806a4750b72cf2288d4b4445 /chrome/browser/cocoa/location_bar | |
parent | ae72160fbabf7868f56e2d4fbc194d6bd49a5598 (diff) | |
download | chromium_src-86f44680f8b6d9dcfb14ad9944c0da5c0832da15.zip chromium_src-86f44680f8b6d9dcfb14ad9944c0da5c0832da15.tar.gz chromium_src-86f44680f8b6d9dcfb14ad9944c0da5c0832da15.tar.bz2 |
Ensure that a browser action is never passed to a function which expects a page action.
(Changed review name, because the solution has changed)
BUG=53041
TEST=On a mac, install a browser action and a page action, right click on each icon, select "Inspect Popup".
Review URL: http://codereview.chromium.org/3176021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57048 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/location_bar')
-rw-r--r-- | chrome/browser/cocoa/location_bar/location_bar_view_mac.h | 4 | ||||
-rw-r--r-- | chrome/browser/cocoa/location_bar/location_bar_view_mac.mm | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/location_bar/location_bar_view_mac.h b/chrome/browser/cocoa/location_bar/location_bar_view_mac.h index d32bc7a..6a7a598 100644 --- a/chrome/browser/cocoa/location_bar/location_bar_view_mac.h +++ b/chrome/browser/cocoa/location_bar/location_bar_view_mac.h @@ -110,7 +110,9 @@ class LocationBarViewMac : public AutocompleteEditController, bool preview_enabled); // Return |page_action|'s info-bubble point in window coordinates. - // Returns |NSZeroPoint| if |page_action| is not present. + // This function should always be called with a visible page action. + // If |page_action| is not a page action or not visible, NOTREACHED() + // is called and this function returns |NSZeroPoint|. NSPoint GetPageActionBubblePoint(ExtensionAction* page_action); // Get the blocked-popup content setting's frame in window diff --git a/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm index fd1acb9..28f524b 100644 --- a/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm +++ b/chrome/browser/cocoa/location_bar/location_bar_view_mac.mm @@ -287,6 +287,8 @@ PageActionDecoration* LocationBarViewMac::GetPageActionDecoration( if (page_action_decorations_[i]->page_action() == page_action) return page_action_decorations_[i]; } + // If |page_action| is the browser action of an extension, no element in + // |page_action_decorations_| will match. NOTREACHED(); return NULL; } |