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

Side by Side Diff: chrome/browser/profile.cc

Issue 418043: Remove --enable-user-script and associated tests. (Closed)
Patch Set: Created 11 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/profile.h" 5 #include "chrome/browser/profile.h"
6 6
7 #include "app/theme_provider.h" 7 #include "app/theme_provider.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 // static 140 // static
141 void Profile::RegisterUserPrefs(PrefService* prefs) { 141 void Profile::RegisterUserPrefs(PrefService* prefs) {
142 prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, true); 142 prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, true);
143 prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, true); 143 prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, true);
144 prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, true); 144 prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, true);
145 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. 145 // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string.
146 prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, 146 prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary,
147 IDS_SPELLCHECK_DICTIONARY); 147 IDS_SPELLCHECK_DICTIONARY);
148 prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true); 148 prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true);
149 prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, true); 149 prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, true);
150 prefs->RegisterBooleanPref(prefs::kEnableUserScripts, false);
151 #if defined(OS_LINUX) 150 #if defined(OS_LINUX)
152 prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, false); 151 prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, false);
153 #endif 152 #endif
154 prefs->RegisterStringPref(prefs::kCurrentThemeID, 153 prefs->RegisterStringPref(prefs::kCurrentThemeID,
155 UTF8ToWide(BrowserThemeProvider::kDefaultThemeID)); 154 UTF8ToWide(BrowserThemeProvider::kDefaultThemeID));
156 prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages); 155 prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages);
157 prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors); 156 prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors);
158 prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints); 157 prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints);
159 prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties); 158 prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties);
160 prefs->RegisterBooleanPref(prefs::kDisableExtensions, false); 159 prefs->RegisterBooleanPref(prefs::kDisableExtensions, false);
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 chromeos_preferences_.Init(prefs); 671 chromeos_preferences_.Init(prefs);
673 #endif 672 #endif
674 } 673 }
675 674
676 void ProfileImpl::InitExtensions() { 675 void ProfileImpl::InitExtensions() {
677 if (user_script_master_ || extensions_service_) 676 if (user_script_master_ || extensions_service_)
678 return; // Already initialized. 677 return; // Already initialized.
679 678
680 const CommandLine* command_line = CommandLine::ForCurrentProcess(); 679 const CommandLine* command_line = CommandLine::ForCurrentProcess();
681 PrefService* prefs = GetPrefs(); 680 PrefService* prefs = GetPrefs();
682 bool user_scripts_enabled =
683 command_line->HasSwitch(switches::kEnableUserScripts) ||
684 prefs->GetBoolean(prefs::kEnableUserScripts);
685
686 FilePath script_dir;
687 if (user_scripts_enabled) {
688 if (command_line->HasSwitch(switches::kUserScriptsDir)) {
689 std::wstring path_string =
690 command_line->GetSwitchValue(switches::kUserScriptsDir);
691 script_dir = FilePath::FromWStringHack(path_string);
692 } else {
693 script_dir = GetPath();
694 script_dir = script_dir.Append(chrome::kUserScriptsDirname);
695 }
696 }
697 681
698 ExtensionErrorReporter::Init(true); // allow noisy errors. 682 ExtensionErrorReporter::Init(true); // allow noisy errors.
683
684 FilePath script_dir; // Don't look for user scripts in any directory.
685 // TODO(aa): We should just remove this functionality,
686 // since it isn't used anymore.
699 user_script_master_ = new UserScriptMaster(script_dir); 687 user_script_master_ = new UserScriptMaster(script_dir);
688
700 extensions_service_ = new ExtensionsService( 689 extensions_service_ = new ExtensionsService(
701 this, 690 this,
702 CommandLine::ForCurrentProcess(), 691 CommandLine::ForCurrentProcess(),
703 GetPrefs(), 692 GetPrefs(),
704 GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName), 693 GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
705 true); 694 true);
706 695
707 extensions_service_->Init(); 696 extensions_service_->Init();
708 697
709 // Load any extensions specified with --load-extension. 698 // Load any extensions specified with --load-extension.
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1447 } 1436 }
1448 if (!sync_service_.get()) 1437 if (!sync_service_.get())
1449 InitSyncService(); 1438 InitSyncService();
1450 return sync_service_.get(); 1439 return sync_service_.get();
1451 } 1440 }
1452 1441
1453 void ProfileImpl::InitSyncService() { 1442 void ProfileImpl::InitSyncService() {
1454 sync_service_.reset(new ProfileSyncService(this)); 1443 sync_service_.reset(new ProfileSyncService(this));
1455 sync_service_->Initialize(); 1444 sync_service_->Initialize();
1456 } 1445 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_startup_unittest.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698