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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 #include "chrome/browser/visitedlink/visitedlink_master.h" | 73 #include "chrome/browser/visitedlink/visitedlink_master.h" |
74 #include "chrome/browser/webdata/web_data_service.h" | 74 #include "chrome/browser/webdata/web_data_service.h" |
75 #include "chrome/common/chrome_constants.h" | 75 #include "chrome/common/chrome_constants.h" |
76 #include "chrome/common/chrome_notification_types.h" | 76 #include "chrome/common/chrome_notification_types.h" |
77 #include "chrome/common/chrome_paths_internal.h" | 77 #include "chrome/common/chrome_paths_internal.h" |
78 #include "chrome/common/chrome_switches.h" | 78 #include "chrome/common/chrome_switches.h" |
79 #include "chrome/common/chrome_version_info.h" | 79 #include "chrome/common/chrome_version_info.h" |
80 #include "chrome/common/pref_names.h" | 80 #include "chrome/common/pref_names.h" |
81 #include "chrome/common/url_constants.h" | 81 #include "chrome/common/url_constants.h" |
82 #include "content/public/browser/browser_thread.h" | 82 #include "content/public/browser/browser_thread.h" |
83 #include "content/public/browser/dom_storage_context.h" | |
83 #include "content/public/browser/host_zoom_map.h" | 84 #include "content/public/browser/host_zoom_map.h" |
84 #include "content/public/browser/notification_service.h" | 85 #include "content/public/browser/notification_service.h" |
85 #include "content/public/browser/user_metrics.h" | 86 #include "content/public/browser/user_metrics.h" |
86 #include "grit/chromium_strings.h" | 87 #include "grit/chromium_strings.h" |
87 #include "grit/generated_resources.h" | 88 #include "grit/generated_resources.h" |
88 #include "ui/base/l10n/l10n_util.h" | 89 #include "ui/base/l10n/l10n_util.h" |
89 | 90 |
90 #if defined(ENABLE_CONFIGURATION_POLICY) | 91 #if defined(ENABLE_CONFIGURATION_POLICY) |
91 #include "chrome/browser/policy/browser_policy_connector.h" | 92 #include "chrome/browser/policy/browser_policy_connector.h" |
92 #else | 93 #else |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 prefs_.reset(PrefService::CreatePrefService( | 294 prefs_.reset(PrefService::CreatePrefService( |
294 GetPrefFilePath(), | 295 GetPrefFilePath(), |
295 policy_service_.get(), | 296 policy_service_.get(), |
296 new ExtensionPrefStore( | 297 new ExtensionPrefStore( |
297 ExtensionPrefValueMapFactory::GetForProfile(this), false), | 298 ExtensionPrefValueMapFactory::GetForProfile(this), false), |
298 false)); | 299 false)); |
299 OnPrefsLoaded(true); | 300 OnPrefsLoaded(true); |
300 } else { | 301 } else { |
301 NOTREACHED(); | 302 NOTREACHED(); |
302 } | 303 } |
304 | |
305 if (command_line->HasSwitch(switches::kEnableRestoreSessionState)) { | |
306 content::BrowserContext::GetDOMStorageContext(this)-> | |
sail
2012/07/12 17:20:04
I guess this is ok. I still think this doesn't hav
marja
2012/07/13 09:05:17
The dom storage layer doesn't know about profiles,
| |
307 SetSaveSessionStorageOnDisk(); | |
308 } | |
303 } | 309 } |
304 | 310 |
305 void ProfileImpl::DoFinalInit(bool is_new_profile) { | 311 void ProfileImpl::DoFinalInit(bool is_new_profile) { |
306 PrefService* prefs = GetPrefs(); | 312 PrefService* prefs = GetPrefs(); |
307 pref_change_registrar_.Init(prefs); | 313 pref_change_registrar_.Init(prefs); |
308 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); | 314 pref_change_registrar_.Add(prefs::kGoogleServicesUsername, this); |
309 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); | 315 pref_change_registrar_.Add(prefs::kDefaultZoomLevel, this); |
310 pref_change_registrar_.Add(prefs::kProfileAvatarIndex, this); | 316 pref_change_registrar_.Add(prefs::kProfileAvatarIndex, this); |
311 pref_change_registrar_.Add(prefs::kProfileName, this); | 317 pref_change_registrar_.Add(prefs::kProfileName, this); |
312 | 318 |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1105 if (!path.empty()) | 1111 if (!path.empty()) |
1106 *cache_path = path; | 1112 *cache_path = path; |
1107 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1113 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1108 prefs_->GetInteger(prefs::kDiskCacheSize); | 1114 prefs_->GetInteger(prefs::kDiskCacheSize); |
1109 } | 1115 } |
1110 | 1116 |
1111 base::Callback<ChromeURLDataManagerBackend*(void)> | 1117 base::Callback<ChromeURLDataManagerBackend*(void)> |
1112 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1118 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1113 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1119 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1114 } | 1120 } |
OLD | NEW |