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/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
99 #include "chrome/installer/util/install_util.h" | 99 #include "chrome/installer/util/install_util.h" |
100 #endif | 100 #endif |
101 | 101 |
102 #if defined(OS_CHROMEOS) | 102 #if defined(OS_CHROMEOS) |
103 #include "chrome/browser/chromeos/enterprise_extension_observer.h" | 103 #include "chrome/browser/chromeos/enterprise_extension_observer.h" |
104 #include "chrome/browser/chromeos/locale_change_guard.h" | 104 #include "chrome/browser/chromeos/locale_change_guard.h" |
105 #include "chrome/browser/chromeos/login/user_manager.h" | 105 #include "chrome/browser/chromeos/login/user_manager.h" |
106 #include "chrome/browser/chromeos/preferences.h" | 106 #include "chrome/browser/chromeos/preferences.h" |
| 107 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
107 #include "chrome/browser/chromeos/proxy_config_service_impl.h" | 108 #include "chrome/browser/chromeos/proxy_config_service_impl.h" |
108 #endif | 109 #endif |
109 | 110 |
110 #if defined(ENABLE_CONFIGURATION_POLICY) | 111 #if defined(ENABLE_CONFIGURATION_POLICY) |
111 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
112 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 113 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
113 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 114 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
114 #else | 115 #else |
115 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" | 116 #include "chrome/browser/policy/cloud/user_cloud_policy_manager.h" |
116 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 117 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 path, delegate, create_mode, sequenced_task_runner.get()); | 269 path, delegate, create_mode, sequenced_task_runner.get()); |
269 } | 270 } |
270 | 271 |
271 // static | 272 // static |
272 int ProfileImpl::create_readme_delay_ms = 60000; | 273 int ProfileImpl::create_readme_delay_ms = 60000; |
273 | 274 |
274 // static | 275 // static |
275 const char* const ProfileImpl::kPrefExitTypeNormal = "Normal"; | 276 const char* const ProfileImpl::kPrefExitTypeNormal = "Normal"; |
276 | 277 |
277 // static | 278 // static |
278 void ProfileImpl::RegisterUserPrefs( | 279 void ProfileImpl::RegisterProfilePrefs( |
279 user_prefs::PrefRegistrySyncable* registry) { | 280 user_prefs::PrefRegistrySyncable* registry) { |
280 registry->RegisterBooleanPref( | 281 registry->RegisterBooleanPref( |
281 prefs::kSavingBrowserHistoryDisabled, | 282 prefs::kSavingBrowserHistoryDisabled, |
282 false, | 283 false, |
283 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 284 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
284 registry->RegisterBooleanPref( | 285 registry->RegisterBooleanPref( |
285 prefs::kAllowDeletingBrowserHistory, | 286 prefs::kAllowDeletingBrowserHistory, |
286 true, | 287 true, |
287 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 288 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
288 registry->RegisterBooleanPref( | 289 registry->RegisterBooleanPref( |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 #endif | 391 #endif |
391 #endif | 392 #endif |
392 profile_policy_connector_ = | 393 profile_policy_connector_ = |
393 policy::ProfilePolicyConnectorFactory::CreateForProfile( | 394 policy::ProfilePolicyConnectorFactory::CreateForProfile( |
394 this, force_immediate_policy_load, sequenced_task_runner); | 395 this, force_immediate_policy_load, sequenced_task_runner); |
395 | 396 |
396 DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS || | 397 DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS || |
397 create_mode == CREATE_MODE_SYNCHRONOUS); | 398 create_mode == CREATE_MODE_SYNCHRONOUS); |
398 bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS; | 399 bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS; |
399 | 400 |
400 chrome::RegisterUserPrefs(pref_registry_.get()); | 401 #if defined(OS_CHROMEOS) |
| 402 if (chromeos::ProfileHelper::IsSigninProfile(this)) |
| 403 chrome::RegisterLoginProfilePrefs(pref_registry_.get()); |
| 404 else |
| 405 #endif |
| 406 chrome::RegisterUserProfilePrefs(pref_registry_.get()); |
401 | 407 |
402 { | 408 { |
403 // On startup, preference loading is always synchronous so a scoped timer | 409 // On startup, preference loading is always synchronous so a scoped timer |
404 // will work here. | 410 // will work here. |
405 startup_metric_utils::ScopedSlowStartupUMA | 411 startup_metric_utils::ScopedSlowStartupUMA |
406 scoped_timer("Startup.SlowStartupPreferenceLoading"); | 412 scoped_timer("Startup.SlowStartupPreferenceLoading"); |
407 prefs_.reset(chrome_prefs::CreateProfilePrefs( | 413 prefs_.reset(chrome_prefs::CreateProfilePrefs( |
408 GetPrefFilePath(), | 414 GetPrefFilePath(), |
409 sequenced_task_runner, | 415 sequenced_task_runner, |
410 profile_policy_connector_->policy_service(), | 416 profile_policy_connector_->policy_service(), |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 base::FilePath* cache_path, | 1156 base::FilePath* cache_path, |
1151 int* max_size) { | 1157 int* max_size) { |
1152 DCHECK(cache_path); | 1158 DCHECK(cache_path); |
1153 DCHECK(max_size); | 1159 DCHECK(max_size); |
1154 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1160 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
1155 if (!path.empty()) | 1161 if (!path.empty()) |
1156 *cache_path = path; | 1162 *cache_path = path; |
1157 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1163 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1158 prefs_->GetInteger(prefs::kDiskCacheSize); | 1164 prefs_->GetInteger(prefs::kDiskCacheSize); |
1159 } | 1165 } |
OLD | NEW |