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

Unified Diff: chrome/browser/extensions/extension_toolbar_model.cc

Issue 496863003: Consolidate ExtensionAction execution code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/extensions/extension_toolbar_model.cc
diff --git a/chrome/browser/extensions/extension_toolbar_model.cc b/chrome/browser/extensions/extension_toolbar_model.cc
index 37e40534b67a74c67a3df885c60271f4d2633092..0f6f9e40788181ed7d036caa05cd1aefa8716199 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -122,40 +122,6 @@ void ExtensionToolbarModel::MoveExtensionIcon(const Extension* extension,
UpdatePrefs();
}
-ExtensionAction::ShowAction ExtensionToolbarModel::ExecuteBrowserAction(
- const Extension* extension,
- Browser* browser,
- GURL* popup_url_out,
- bool should_grant) {
- content::WebContents* web_contents = NULL;
- int tab_id = 0;
- if (!ExtensionTabUtil::GetDefaultTab(browser, &web_contents, &tab_id))
- return ExtensionAction::ACTION_NONE;
-
- ExtensionAction* browser_action =
- ExtensionActionManager::Get(profile_)->GetBrowserAction(*extension);
-
- // For browser actions, visibility == enabledness.
- if (!browser_action->GetIsVisible(tab_id))
- return ExtensionAction::ACTION_NONE;
-
- if (should_grant) {
- TabHelper::FromWebContents(web_contents)
- ->active_tab_permission_granter()
- ->GrantIfRequested(extension);
- }
-
- if (browser_action->HasPopup(tab_id)) {
- if (popup_url_out)
- *popup_url_out = browser_action->GetPopupUrl(tab_id);
- return ExtensionAction::ACTION_SHOW_POPUP;
- }
-
- ExtensionActionAPI::BrowserActionExecuted(
- browser->profile(), *browser_action, web_contents);
- return ExtensionAction::ACTION_NONE;
-}
-
void ExtensionToolbarModel::SetVisibleIconCount(int count) {
visible_icon_count_ =
count == static_cast<int>(toolbar_items_.size()) ? -1 : count;
« no previous file with comments | « chrome/browser/extensions/extension_toolbar_model.h ('k') | chrome/browser/extensions/location_bar_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698