Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5042)

Unified Diff: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm

Issue 489183005: Make a ShowExtensionActionPopup function (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Peter's Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
index d69971dd6d50a9d5c5771e4e38fe8dff7f57e6a6..6d587d001fee6f8f91534870114350d5fd7d189e 100644
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
@@ -86,23 +86,26 @@ bool PageActionDecoration::AcceptsMousePress() {
// Either notify listeners or show a popup depending on the Page
// Action.
bool PageActionDecoration::OnMousePressed(NSRect frame, NSPoint location) {
- return ActivatePageAction(frame);
+ ActivatePageAction(frame, true);
+ // We don't want other code to try and handle this click. Returning true
+ // prevents this by indicating that we handled it.
+ return true;
}
-void PageActionDecoration::ActivatePageAction() {
- ActivatePageAction(owner_->GetPageActionFrame(page_action_));
+bool PageActionDecoration::ActivatePageAction(bool grant_active_tab) {
+ return ActivatePageAction(
+ owner_->GetPageActionFrame(page_action_), grant_active_tab);
}
-bool PageActionDecoration::ActivatePageAction(NSRect frame) {
+bool PageActionDecoration::ActivatePageAction(
+ NSRect frame, bool grant_active_tab) {
WebContents* web_contents = owner_->GetWebContents();
- if (!web_contents) {
- // We don't want other code to try and handle this click. Returning true
- // prevents this by indicating that we handled it.
- return true;
- }
+ if (!web_contents)
+ return false;
switch (extensions::ExtensionActionAPI::Get(browser_->profile())->
- ExecuteExtensionAction(GetExtension(), browser_, true)) {
+ ExecuteExtensionAction(
+ GetExtension(), browser_, grant_active_tab)) {
case ExtensionAction::ACTION_NONE:
break;
@@ -240,7 +243,7 @@ void PageActionDecoration::Observe(
if (extension_id != page_action_->extension_id())
break;
if (IsVisible())
- ActivatePageAction();
+ ActivatePageAction(true);
break;
}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/page_action_decoration.h ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698