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

Unified Diff: chrome/browser/extensions/api/extension_action/extension_actions_api.cc

Issue 10703090: Turn pageAction.show -> browserAction.sensibleThing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: views (incomplete) 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/extension_action/extension_actions_api.cc
diff --git a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
index fb17ffd16a40967572d22bfdf3a12a44656b62e3..84875a09697c20a8298b91c78927e06d6bc57615 100644
--- a/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
+++ b/chrome/browser/extensions/api/extension_action/extension_actions_api.cc
@@ -114,13 +114,18 @@ bool ExtensionActionFunction::RunImpl() {
void ExtensionActionFunction::NotifyChange() {
switch (extension_action_->action_type()) {
- case ExtensionAction::TYPE_BROWSER:
- NotifyBrowserActionChange();
- return;
- case ExtensionAction::TYPE_PAGE:
case ExtensionAction::TYPE_SCRIPT_BADGE:
NotifyLocationBarChange();
return;
+ case ExtensionAction::TYPE_BROWSER:
+ case ExtensionAction::TYPE_PAGE:
+ if (extension_->browser_action())
+ NotifyBrowserActionChange();
+ else if (extension_->page_action())
+ NotifyLocationBarChange();
+ else
+ NOTREACHED();
+ return;
}
NOTREACHED();
}
@@ -174,10 +179,6 @@ bool ExtensionActionFunction::ParseCSSColorString(
}
bool ExtensionActionFunction::SetVisible(bool visible) {
- // If --enable-script-badges is on there will be a browser_action here
- // instead of a page action. Disable/renable the browser action perhaps?
- if (!GetExtension()->page_action())
- return true;
extension_action_->SetIsVisible(tab_id_, visible);
NotifyChange();
return true;
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_toolbar_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698