OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/environment.h" | 10 #include "base/environment.h" |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 prefs_.reset(PrefService::CreatePrefService( | 293 prefs_.reset(PrefService::CreatePrefService( |
294 GetPrefFilePath(), | 294 GetPrefFilePath(), |
295 policy_service_.get(), | 295 policy_service_.get(), |
296 new ExtensionPrefStore( | 296 new ExtensionPrefStore( |
297 ExtensionPrefValueMapFactory::GetForProfile(this), false), | 297 ExtensionPrefValueMapFactory::GetForProfile(this), false), |
298 false)); | 298 false)); |
299 OnPrefsLoaded(true); | 299 OnPrefsLoaded(true); |
300 } else { | 300 } else { |
301 NOTREACHED(); | 301 NOTREACHED(); |
302 } | 302 } |
| 303 |
| 304 if (command_line->HasSwitch(switches::kEnableRestoreSessionState)) { |
| 305 bool success = BrowserContext::SetSaveSessionStorageOnDisk(this, true); |
| 306 DCHECK(success); |
| 307 } |
303 } | 308 } |
304 | 309 |
305 void ProfileImpl::DoFinalInit(bool is_new_profile) { | 310 void ProfileImpl::DoFinalInit(bool is_new_profile) { |
306 PrefService* prefs = GetPrefs(); | 311 PrefService* prefs = GetPrefs(); |
307 pref_change_registrar_.Init(prefs); | 312 pref_change_registrar_.Init(prefs); |
308 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); | 313 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); |
309 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); | 314 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); |
310 pref_change_registrar_.Add(prefs::kProfileAvatarIndex, this); | 315 pref_change_registrar_.Add(prefs::kProfileAvatarIndex, this); |
311 pref_change_registrar_.Add(prefs::kProfileName, this); | 316 pref_change_registrar_.Add(prefs::kProfileName, this); |
312 | 317 |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 if (!path.empty()) | 1110 if (!path.empty()) |
1106 *cache_path = path; | 1111 *cache_path = path; |
1107 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1112 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1108 prefs_->GetInteger(prefs::kDiskCacheSize); | 1113 prefs_->GetInteger(prefs::kDiskCacheSize); |
1109 } | 1114 } |
1110 | 1115 |
1111 base::Callback<ChromeURLDataManagerBackend*(void)> | 1116 base::Callback<ChromeURLDataManagerBackend*(void)> |
1112 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1117 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1113 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1118 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1114 } | 1119 } |
OLD | NEW |