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

Unified Diff: chrome/common/extensions/feature_switch.cc

Issue 11038021: Implement Chrome Extension TabCapture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort Created 8 years, 2 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/feature_switch.cc
diff --git a/chrome/common/extensions/feature_switch.cc b/chrome/common/extensions/feature_switch.cc
index 1bc70ae51254d5291c085554d2a0c729eed71095..97a75def03f0ec9f1d41a17d12a56db8614e7cbd 100644
--- a/chrome/common/extensions/feature_switch.cc
+++ b/chrome/common/extensions/feature_switch.cc
@@ -8,6 +8,7 @@
#include "base/lazy_instance.h"
#include "base/string_util.h"
#include "chrome/common/chrome_switches.h"
+#include "content/public/common/content_switches.h"
namespace extensions {
@@ -33,7 +34,10 @@ class CommonSwitches {
FeatureSwitch::DEFAULT_DISABLED),
prompt_for_external_extensions(
switches::kPromptForExternalExtensions,
- FeatureSwitch::DEFAULT_ENABLED)
+ FeatureSwitch::DEFAULT_ENABLED),
+ tab_capture(
+ switches::kEnableTabCapture,
+ FeatureSwitch::DEFAULT_DISABLED)
{
// Disabling easy off-store installation is not yet implemented for Aura. Not
// sure what the Aura equivalent for this UI is.
@@ -53,6 +57,7 @@ class CommonSwitches {
FeatureSwitch script_badges;
FeatureSwitch script_bubble;
FeatureSwitch prompt_for_external_extensions;
+ FeatureSwitch tab_capture;
};
base::LazyInstance<CommonSwitches> g_common_switches =
@@ -79,6 +84,9 @@ FeatureSwitch* FeatureSwitch::script_bubble() {
FeatureSwitch* FeatureSwitch::prompt_for_external_extensions() {
return &g_common_switches.Get().prompt_for_external_extensions;
}
+FeatureSwitch* FeatureSwitch::tab_capture() {
+ return &g_common_switches.Get().tab_capture;
+}
FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature,
@@ -133,6 +141,9 @@ bool FeatureSwitch::IsEnabled() const {
if (default_value_ && command_line_->HasSwitch(GetLegacyDisableFlag()))
return false;
+ if (!default_value_ && command_line_->HasSwitch(switch_name_))
+ return true;
+
return default_value_;
}

Powered by Google App Engine
This is Rietveld 408576698