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

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

Issue 5213002: Fix for Bug 50726 "Save extension list and "winning" prefs from extensions" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: reuse old DefaultPrefStore as InMemoryPrefStore Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_impl.h" 5 #include "chrome/browser/profile_impl.h"
6 6
7 #include "app/resource_bundle.h" 7 #include "app/resource_bundle.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 created_web_data_service_(false), 254 created_web_data_service_(false),
255 created_password_store_(false), 255 created_password_store_(false),
256 created_download_manager_(false), 256 created_download_manager_(false),
257 created_theme_provider_(false), 257 created_theme_provider_(false),
258 start_time_(Time::Now()), 258 start_time_(Time::Now()),
259 spellcheck_host_(NULL), 259 spellcheck_host_(NULL),
260 spellcheck_host_ready_(false), 260 spellcheck_host_ready_(false),
261 #if defined(OS_WIN) 261 #if defined(OS_WIN)
262 checked_instant_promo_(false), 262 checked_instant_promo_(false),
263 #endif 263 #endif
264 shutdown_session_service_(false) { 264 shutdown_session_service_(false),
265 tmp_extension_prefs_(NULL) {
265 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << 266 DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
266 "profile files to the root directory!"; 267 "profile files to the root directory!";
267 create_session_service_timer_.Start( 268 create_session_service_timer_.Start(
268 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, 269 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
269 &ProfileImpl::EnsureSessionServiceCreated); 270 &ProfileImpl::EnsureSessionServiceCreated);
270 271
271 PrefService* prefs = GetPrefs(); 272 PrefService* prefs = GetPrefs();
272 pref_change_registrar_.Init(prefs); 273 pref_change_registrar_.Init(prefs);
273 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this); 274 pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this);
274 pref_change_registrar_.Add(prefs::kEnableSpellCheck, this); 275 pref_change_registrar_.Add(prefs::kEnableSpellCheck, this);
275 pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this); 276 pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
276 277
278 // Ensure that preferences set by extensions are restored in the profile
279 // as early as possible. The constructor takes care of that.
280 tmp_extension_prefs_.reset(new ExtensionPrefs(
281 GetPrefs(),
282 GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName)));
283
277 // Convert active labs into switches. Modifies the current command line. 284 // Convert active labs into switches. Modifies the current command line.
278 about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess()); 285 about_flags::ConvertFlagsToSwitches(prefs, CommandLine::ForCurrentProcess());
279 286
280 #if defined(OS_MACOSX) 287 #if defined(OS_MACOSX)
281 // If the profile directory doesn't already have a cache directory and it 288 // If the profile directory doesn't already have a cache directory and it
282 // is under ~/Library/Application Support, use a suitable cache directory 289 // is under ~/Library/Application Support, use a suitable cache directory
283 // under ~/Library/Caches. For example, a profile directory of 290 // under ~/Library/Caches. For example, a profile directory of
284 // ~/Library/Application Support/Google/Chrome/MyProfileName that doesn't 291 // ~/Library/Application Support/Google/Chrome/MyProfileName that doesn't
285 // have a "Cache" or "MediaCache" subdirectory would use the cache directory 292 // have a "Cache" or "MediaCache" subdirectory would use the cache directory
286 // ~/Library/Caches/Google/Chrome/MyProfileName. 293 // ~/Library/Caches/Google/Chrome/MyProfileName.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 383
377 FilePath script_dir; // Don't look for user scripts in any directory. 384 FilePath script_dir; // Don't look for user scripts in any directory.
378 // TODO(aa): We should just remove this functionality, 385 // TODO(aa): We should just remove this functionality,
379 // since it isn't used anymore. 386 // since it isn't used anymore.
380 user_script_master_ = new UserScriptMaster(script_dir, this); 387 user_script_master_ = new UserScriptMaster(script_dir, this);
381 388
382 extensions_service_ = new ExtensionsService( 389 extensions_service_ = new ExtensionsService(
383 this, 390 this,
384 CommandLine::ForCurrentProcess(), 391 CommandLine::ForCurrentProcess(),
385 GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName), 392 GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
393 tmp_extension_prefs_.release(),
386 true); 394 true);
387 395
388 RegisterComponentExtensions(); 396 RegisterComponentExtensions();
389 extensions_service_->Init(); 397 extensions_service_->Init();
390 InstallDefaultApps(); 398 InstallDefaultApps();
391 399
392 // Load any extensions specified with --load-extension. 400 // Load any extensions specified with --load-extension.
393 if (command_line->HasSwitch(switches::kLoadExtension)) { 401 if (command_line->HasSwitch(switches::kLoadExtension)) {
394 FilePath path = command_line->GetSwitchValuePath(switches::kLoadExtension); 402 FilePath path = command_line->GetSwitchValuePath(switches::kLoadExtension);
395 extensions_service_->LoadExtension(path); 403 extensions_service_->LoadExtension(path);
(...skipping 940 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 #if defined(OS_CHROMEOS) 1344 #if defined(OS_CHROMEOS)
1337 chromeos::ProxyConfigServiceImpl* 1345 chromeos::ProxyConfigServiceImpl*
1338 ProfileImpl::GetChromeOSProxyConfigServiceImpl() { 1346 ProfileImpl::GetChromeOSProxyConfigServiceImpl() {
1339 if (!chromeos_proxy_config_service_impl_) { 1347 if (!chromeos_proxy_config_service_impl_) {
1340 chromeos_proxy_config_service_impl_ = 1348 chromeos_proxy_config_service_impl_ =
1341 new chromeos::ProxyConfigServiceImpl(); 1349 new chromeos::ProxyConfigServiceImpl();
1342 } 1350 }
1343 return chromeos_proxy_config_service_impl_; 1351 return chromeos_proxy_config_service_impl_;
1344 } 1352 }
1345 #endif // defined(OS_CHROMEOS) 1353 #endif // defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698