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

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

Issue 10700007: Page actions behave as disableable browser actions when script badges are enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: estade + sky Created 8 years, 5 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 144b2b510f51723996e9e579d7d113c1b429930d..74c814180e359da8bc43f2d4b70b17efcdd4a817 100644
--- a/chrome/browser/extensions/extension_toolbar_model.cc
+++ b/chrome/browser/extensions/extension_toolbar_model.cc
@@ -97,10 +97,15 @@ ExtensionToolbarModel::Action ExtensionToolbarModel::ExecuteBrowserAction(
if (tab_id < 0)
return ACTION_NONE;
+ ExtensionAction* browser_action = extension->browser_action();
+
+ // For browser actions, visibility == enabledness.
+ if (!browser_action->GetIsVisible(tab_id))
+ return ACTION_NONE;
+
tab_contents->extension_tab_helper()->active_tab_permission_manager()->
GrantIfRequested(extension);
- ExtensionAction* browser_action = extension->browser_action();
if (browser_action->HasPopup(tab_id)) {
if (popup_url_out)
*popup_url_out = browser_action->GetPopupUrl(tab_id);

Powered by Google App Engine
This is Rietveld 408576698