OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 if (!extensions_enabled) | 488 if (!extensions_enabled) |
489 autoupdate_enabled = false; | 489 autoupdate_enabled = false; |
490 else | 490 else |
491 autoupdate_enabled = !command_line->HasSwitch(switches::kGuestSession); | 491 autoupdate_enabled = !command_line->HasSwitch(switches::kGuestSession); |
492 #endif | 492 #endif |
493 extension_service_.reset(new ExtensionService( | 493 extension_service_.reset(new ExtensionService( |
494 this, | 494 this, |
495 CommandLine::ForCurrentProcess(), | 495 CommandLine::ForCurrentProcess(), |
496 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 496 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
497 extension_prefs_.get(), | 497 extension_prefs_.get(), |
498 extension_settings_.get(), | |
499 autoupdate_enabled, | 498 autoupdate_enabled, |
500 extensions_enabled)); | 499 extensions_enabled)); |
501 | 500 |
502 RegisterComponentExtensions(); | 501 RegisterComponentExtensions(); |
503 extension_service_->Init(); | 502 extension_service_->Init(); |
504 | 503 |
505 if (extensions_enabled) { | 504 if (extensions_enabled) { |
506 // Load any extensions specified with --load-extension. | 505 // Load any extensions specified with --load-extension. |
507 if (command_line->HasSwitch(switches::kLoadExtension)) { | 506 if (command_line->HasSwitch(switches::kLoadExtension)) { |
508 FilePath path = command_line->GetSwitchValuePath( | 507 FilePath path = command_line->GetSwitchValuePath( |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
920 // Make sure we save to disk that the session has opened. | 919 // Make sure we save to disk that the session has opened. |
921 prefs_->ScheduleSavePersistentPrefs(); | 920 prefs_->ScheduleSavePersistentPrefs(); |
922 | 921 |
923 // Ensure that preferences set by extensions are restored in the profile | 922 // Ensure that preferences set by extensions are restored in the profile |
924 // as early as possible. The constructor takes care of that. | 923 // as early as possible. The constructor takes care of that. |
925 extension_prefs_.reset(new ExtensionPrefs( | 924 extension_prefs_.reset(new ExtensionPrefs( |
926 prefs_.get(), | 925 prefs_.get(), |
927 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 926 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
928 GetExtensionPrefValueMap())); | 927 GetExtensionPrefValueMap())); |
929 | 928 |
930 extension_settings_ = new ExtensionSettings( | |
931 GetPath().AppendASCII(ExtensionService::kSettingsDirectoryName)); | |
932 | |
933 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 929 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
934 | 930 |
935 DCHECK(!net_pref_observer_.get()); | 931 DCHECK(!net_pref_observer_.get()); |
936 net_pref_observer_.reset( | 932 net_pref_observer_.reset( |
937 new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_)); | 933 new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_)); |
938 | 934 |
939 DoFinalInit(); | 935 DoFinalInit(); |
940 } | 936 } |
941 | 937 |
942 PrefService* ProfileImpl::GetPrefs() { | 938 PrefService* ProfileImpl::GetPrefs() { |
(...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1753 | 1749 |
1754 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { | 1750 chrome_browser_net::Predictor* ProfileImpl::GetNetworkPredictor() { |
1755 return predictor_; | 1751 return predictor_; |
1756 } | 1752 } |
1757 | 1753 |
1758 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1754 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
1759 if (!spellcheck_profile_.get()) | 1755 if (!spellcheck_profile_.get()) |
1760 spellcheck_profile_.reset(new SpellCheckProfile()); | 1756 spellcheck_profile_.reset(new SpellCheckProfile()); |
1761 return spellcheck_profile_.get(); | 1757 return spellcheck_profile_.get(); |
1762 } | 1758 } |
OLD | NEW |