summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authormpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-10 23:24:16 +0000
committermpcomplete@chromium.org <mpcomplete@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-10 23:24:16 +0000
commit244117d8e70fc447149b785b88ff56980bfd5229 (patch)
tree3afd27e304c19139c4582680424e35a42cd7472c /extensions
parent9058617fb69a795db21186004070175c14d18be4 (diff)
downloadchromium_src-244117d8e70fc447149b785b88ff56980bfd5229.zip
chromium_src-244117d8e70fc447149b785b88ff56980bfd5229.tar.gz
chromium_src-244117d8e70fc447149b785b88ff56980bfd5229.tar.bz2
Remove --prompt-for-extension-extensions switch. FeatureSwitch now can accept
NULL switch names, in which case it can't be controlled by the command line. BUG=343979 Review URL: https://codereview.chromium.org/189993004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256064 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'extensions')
-rw-r--r--extensions/common/feature_switch.cc7
-rw-r--r--extensions/common/feature_switch.h8
-rw-r--r--extensions/common/switches.cc4
-rw-r--r--extensions/common/switches.h1
4 files changed, 11 insertions, 9 deletions
diff --git a/extensions/common/feature_switch.cc b/extensions/common/feature_switch.cc
index 55b54ce..83a4107 100644
--- a/extensions/common/feature_switch.cc
+++ b/extensions/common/feature_switch.cc
@@ -27,7 +27,7 @@ class CommonSwitches {
switches::kGlobalCommands,
FeatureSwitch::DEFAULT_DISABLED),
prompt_for_external_extensions(
- switches::kPromptForExternalExtensions,
+ NULL,
#if defined(OS_WIN)
FeatureSwitch::DEFAULT_ENABLED),
#else
@@ -108,6 +108,9 @@ bool FeatureSwitch::IsEnabled() const {
if (override_value_ != OVERRIDE_NONE)
return override_value_ == OVERRIDE_ENABLED;
+ if (!switch_name_)
+ return default_value_;
+
std::string temp = command_line_->GetSwitchValueASCII(switch_name_);
std::string switch_value;
base::TrimWhitespaceASCII(temp, base::TRIM_ALL, &switch_value);
@@ -128,10 +131,12 @@ bool FeatureSwitch::IsEnabled() const {
}
std::string FeatureSwitch::GetLegacyEnableFlag() const {
+ DCHECK(switch_name_);
return std::string("enable-") + switch_name_;
}
std::string FeatureSwitch::GetLegacyDisableFlag() const {
+ DCHECK(switch_name_);
return std::string("disable-") + switch_name_;
}
diff --git a/extensions/common/feature_switch.h b/extensions/common/feature_switch.h
index bbfd2c7..40143d6 100644
--- a/extensions/common/feature_switch.h
+++ b/extensions/common/feature_switch.h
@@ -46,6 +46,8 @@ class FeatureSwitch {
DISALLOW_COPY_AND_ASSIGN(ScopedOverride);
};
+ // |switch_name| can be NULL, in which case the feature is controlled solely
+ // by the default and override values.
FeatureSwitch(const char* switch_name,
DefaultValue default_value);
FeatureSwitch(const CommandLine* command_line,
@@ -58,14 +60,14 @@ class FeatureSwitch {
bool IsEnabled() const;
- std::string GetLegacyEnableFlag() const;
- std::string GetLegacyDisableFlag() const;
-
private:
void Init(const CommandLine* command_line,
const char* switch_name,
DefaultValue default_value);
+ std::string GetLegacyEnableFlag() const;
+ std::string GetLegacyDisableFlag() const;
+
const CommandLine* command_line_;
const char* switch_name_;
bool default_value_;
diff --git a/extensions/common/switches.cc b/extensions/common/switches.cc
index 9a1a919..b709630 100644
--- a/extensions/common/switches.cc
+++ b/extensions/common/switches.cc
@@ -59,10 +59,6 @@ const char kForceDevModeHighlighting[] = "force-dev-mode-highlighting";
// Enables setting global commands through the Extensions Commands API.
const char kGlobalCommands[] = "global-commands";
-// Should we prompt the user before allowing external extensions to install?
-// Default is yes.
-const char kPromptForExternalExtensions[] = "prompt-for-external-extensions";
-
// Makes component extensions appear in chrome://settings/extensions.
const char kShowComponentExtensionOptions[] =
"show-component-extension-options";
diff --git a/extensions/common/switches.h b/extensions/common/switches.h
index 6f08870..64f8189 100644
--- a/extensions/common/switches.h
+++ b/extensions/common/switches.h
@@ -24,7 +24,6 @@ extern const char kExtensionProcess[];
extern const char kExtensionsOnChromeURLs[];
extern const char kForceDevModeHighlighting[];
extern const char kGlobalCommands[];
-extern const char kPromptForExternalExtensions[];
extern const char kShowComponentExtensionOptions[];
} // namespace switches