Chromium Code Reviews| 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 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 925 | 925 |
| 926 // The last session exited cleanly if there is no pref for | 926 // The last session exited cleanly if there is no pref for |
| 927 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. | 927 // kSessionExitedCleanly or the value for kSessionExitedCleanly is true. |
| 928 last_session_exited_cleanly_ = | 928 last_session_exited_cleanly_ = |
| 929 prefs_->GetBoolean(prefs::kSessionExitedCleanly); | 929 prefs_->GetBoolean(prefs::kSessionExitedCleanly); |
| 930 // Mark the session as open. | 930 // Mark the session as open. |
| 931 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); | 931 prefs_->SetBoolean(prefs::kSessionExitedCleanly, false); |
| 932 // Make sure we save to disk that the session has opened. | 932 // Make sure we save to disk that the session has opened. |
| 933 prefs_->ScheduleSavePersistentPrefs(); | 933 prefs_->ScheduleSavePersistentPrefs(); |
| 934 | 934 |
| 935 bool extensions_disabled = | |
| 936 (prefs_->FindPreference(prefs::kDisableExtensions) && | |
| 937 prefs_->GetBoolean(prefs::kDisableExtensions)) || | |
| 938 CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableExtensions); | |
|
Mattias Nissler (ping if slow)
2011/09/29 12:20:07
Hm, maybe handle the switch in CommandLinePrefStor
battre
2011/09/29 14:50:18
I looked into this and decided against it: It woul
| |
| 939 | |
| 935 // Ensure that preferences set by extensions are restored in the profile | 940 // Ensure that preferences set by extensions are restored in the profile |
| 936 // as early as possible. The constructor takes care of that. | 941 // as early as possible. The constructor takes care of that. |
| 937 extension_prefs_.reset(new ExtensionPrefs( | 942 extension_prefs_.reset(new ExtensionPrefs( |
| 938 prefs_.get(), | 943 prefs_.get(), |
| 939 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), | 944 GetPath().AppendASCII(ExtensionService::kInstallDirectoryName), |
| 940 GetExtensionPrefValueMap())); | 945 GetExtensionPrefValueMap(), |
| 946 extensions_disabled)); | |
| 941 | 947 |
| 942 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); | 948 ProfileDependencyManager::GetInstance()->CreateProfileServices(this, false); |
| 943 | 949 |
| 944 DCHECK(!net_pref_observer_.get()); | 950 DCHECK(!net_pref_observer_.get()); |
| 945 net_pref_observer_.reset( | 951 net_pref_observer_.reset( |
| 946 new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_)); | 952 new NetPrefObserver(prefs_.get(), GetPrerenderManager(), predictor_)); |
| 947 | 953 |
| 948 DoFinalInit(); | 954 DoFinalInit(); |
| 949 } | 955 } |
| 950 | 956 |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1764 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1770 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
| 1765 if (!spellcheck_profile_.get()) | 1771 if (!spellcheck_profile_.get()) |
| 1766 spellcheck_profile_.reset(new SpellCheckProfile()); | 1772 spellcheck_profile_.reset(new SpellCheckProfile()); |
| 1767 return spellcheck_profile_.get(); | 1773 return spellcheck_profile_.get(); |
| 1768 } | 1774 } |
| 1769 | 1775 |
| 1770 void ProfileImpl::SetDownloadManagerDelegate( | 1776 void ProfileImpl::SetDownloadManagerDelegate( |
| 1771 ChromeDownloadManagerDelegate* delegate) { | 1777 ChromeDownloadManagerDelegate* delegate) { |
| 1772 download_manager_delegate_ = delegate; | 1778 download_manager_delegate_ = delegate; |
| 1773 } | 1779 } |
| OLD | NEW |