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

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

Issue 10565017: Parse the script_badge manifest section. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix more review comments, and make script_badge_ non-mutable Created 8 years, 6 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/script_badge_controller.cc
diff --git a/chrome/browser/extensions/script_badge_controller.cc b/chrome/browser/extensions/script_badge_controller.cc
index 7efd6a99a4e32176d5c80e69c245e44681624ff8..5a16b0e6091300f5b62c57fc0f6d4925ee168b9e 100644
--- a/chrome/browser/extensions/script_badge_controller.cc
+++ b/chrome/browser/extensions/script_badge_controller.cc
@@ -11,6 +11,7 @@
#include "chrome/common/extensions/extension_action.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_set.h"
+#include "chrome/common/extensions/extension_switch_utils.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
@@ -24,7 +25,11 @@ namespace extensions {
ScriptBadgeController::ScriptBadgeController(TabContents* tab_contents)
: content::WebContentsObserver(tab_contents->web_contents()),
script_executor_(tab_contents->web_contents()),
- tab_contents_(tab_contents) {}
+ tab_contents_(tab_contents) {
+ DCHECK(switch_utils::AreScriptBadgesEnabled())
+ << "This class will only be constructed from ExtensionTabHelper if "
+ << "script badges have been enabled.";
+}
ScriptBadgeController::~ScriptBadgeController() {}
@@ -41,7 +46,7 @@ ScriptBadgeController::GetCurrentActions() {
it != service->extensions()->end(); ++it) {
const Extension* extension = *it;
if (extensions_executing_scripts_.count(extension->id()))
- current_actions->push_back(extension->GetScriptBadge());
+ current_actions->push_back(extension->script_badge());
}
return current_actions.Pass();
}

Powered by Google App Engine
This is Rietveld 408576698