summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 01:26:13 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-19 01:26:13 +0000
commitf93fe78db9c83619fd55aeccdade102915404c28 (patch)
treecba3becbcc66eb1d04baff57fe830bff1a1d46cc /chrome/browser/profile.cc
parent5ba0a2cc590e74be37190774d6b8db1f418d7906 (diff)
downloadchromium_src-f93fe78db9c83619fd55aeccdade102915404c28.zip
chromium_src-f93fe78db9c83619fd55aeccdade102915404c28.tar.gz
chromium_src-f93fe78db9c83619fd55aeccdade102915404c28.tar.bz2
Support controlling extensions with a pref in addition to command-line.
Review URL: http://codereview.chromium.org/20481 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 66f75d8..4602c91 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -72,6 +72,8 @@ void Profile::RegisterUserPrefs(PrefService* prefs) {
IDS_SPELLCHECK_DICTIONARY);
#endif
prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true);
+ prefs->RegisterBooleanPref(prefs::kEnableUserScripts, false);
+ prefs->RegisterBooleanPref(prefs::kEnableExtensions, false);
}
// static
@@ -352,10 +354,13 @@ void ProfileImpl::InitExtensions() {
return; // Already initialized.
const CommandLine* command_line = CommandLine::ForCurrentProcess();
+ PrefService* prefs = GetPrefs();
bool user_scripts_enabled =
- command_line->HasSwitch(switches::kEnableUserScripts);
+ command_line->HasSwitch(switches::kEnableUserScripts) ||
+ prefs->GetBoolean(prefs::kEnableUserScripts);
bool extensions_enabled =
- command_line->HasSwitch(switches::kEnableExtensions);
+ command_line->HasSwitch(switches::kEnableExtensions) ||
+ prefs->GetBoolean(prefs::kEnableExtensions);
FilePath script_dir;
if (user_scripts_enabled) {