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

Unified Diff: chrome/browser/ui/browser_commands.cc

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
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model_unittest.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser_commands.cc
diff --git a/chrome/browser/ui/browser_commands.cc b/chrome/browser/ui/browser_commands.cc
index fbd211b945da6567a12f91d43ac75dca6589610f..0cda9b9361e30371394e561f5306c44a8aecd452 100644
--- a/chrome/browser/ui/browser_commands.cc
+++ b/chrome/browser/ui/browser_commands.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/dom_distiller/tab_utils.h"
#include "chrome/browser/extensions/api/commands/command_service.h"
+#include "chrome/browser/extensions/api/extension_action/extension_action_api.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/favicon/favicon_tab_helper.h"
#include "chrome/browser/lifetime/application_lifetime.h"
@@ -745,18 +746,16 @@ void BookmarkCurrentPage(Browser* browser) {
switch (command_type) {
case extensions::CommandService::NAMED:
browser->window()->ExecuteExtensionCommand(extension, command);
- return;
-
+ break;
case extensions::CommandService::BROWSER_ACTION:
- // BookmarkCurrentPage is called through a user gesture, so it is safe
- // to call ShowBrowserActionPopup.
- browser->window()->ShowBrowserActionPopup(extension);
- return;
-
case extensions::CommandService::PAGE_ACTION:
- browser->window()->ShowPageActionPopup(extension);
- return;
+ // BookmarkCurrentPage is called through a user gesture, so it is safe
+ // to grant the active tab permission.
+ extensions::ExtensionActionAPI::Get(browser->profile())->
+ ShowExtensionActionPopup(extension, browser, true);
+ break;
}
+ return;
}
BookmarkCurrentPageInternal(browser);
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model_unittest.cc ('k') | chrome/browser/ui/browser_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698