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

Unified Diff: chrome/common/extensions/extension_switch_utils.h

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/common/extensions/extension_switch_utils.h
diff --git a/chrome/common/extensions/extension_switch_utils.h b/chrome/common/extensions/extension_switch_utils.h
index e5e095c425dde22f5bedf509d2269b88b4d138fd..66f2666f8712b854436485f053642e0406204b9a 100644
--- a/chrome/common/extensions/extension_switch_utils.h
+++ b/chrome/common/extensions/extension_switch_utils.h
@@ -16,6 +16,20 @@ bool IsActionBoxEnabled();
bool AreScriptBadgesEnabled();
+// TODO(jyasskin): Convert this to a generic switch system that wraps the whole
+// interaction with CommandLine::HasSwitch and doesn't require globals.
+enum EnabledState {
+ ENABLED,
+ DISABLED
+};
+
+// Using this makes all other access to AreScriptBadgesEnabled NOT thread-safe.
+class ScopedSetScriptBadgeForTest {
+ public:
+ explicit ScopedSetScriptBadgeForTest(EnabledState);
+ ~ScopedSetScriptBadgeForTest();
+};
+
} // switch_utils
} // extensions

Powered by Google App Engine
This is Rietveld 408576698