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

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: 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..ce93f45d2d12c6467eeb687dfa513f6ac5b778d5 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,10 @@ 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) {
+ CHECK(switch_utils::IsActionBoxEnabled())
+ << "Without this, extension->script_badge() would return NULL.";
not at google - send to devlin 2012/06/18 18:51:24 Is this necessary? We only construct these objects
Jeffrey Yasskin 2012/06/18 22:16:03 The CHECK is intended to tell people reading the c
not at google - send to devlin 2012/06/18 22:59:41 Maybe just a comment would be more appropriate the
Jeffrey Yasskin 2012/06/18 23:58:41 I put the comment inside the DCHECK. For future r
not at google - send to devlin 2012/06/19 00:27:32 I think of DCHECK as documentation and CHECK as bu
Jeffrey Yasskin 2012/06/19 21:43:08 Now that script_badge() always returns non-NULL, I
+}
ScriptBadgeController::~ScriptBadgeController() {}
@@ -41,7 +45,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