| 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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 // If we are creating the profile synchronously, then we should load the | 381 // If we are creating the profile synchronously, then we should load the |
| 382 // policy data immediately. | 382 // policy data immediately. |
| 383 bool force_immediate_policy_load = (create_mode == CREATE_MODE_SYNCHRONOUS); | 383 bool force_immediate_policy_load = (create_mode == CREATE_MODE_SYNCHRONOUS); |
| 384 | 384 |
| 385 // TODO(atwilson): Change |cloud_policy_manager_| and | 385 // TODO(atwilson): Change |cloud_policy_manager_| and |
| 386 // |managed_mode_policy_provider_| to proper ProfileKeyedServices once | 386 // |managed_mode_policy_provider_| to proper ProfileKeyedServices once |
| 387 // PrefServiceSyncable is a ProfileKeyedService (policy must be initialized | 387 // PrefServiceSyncable is a ProfileKeyedService (policy must be initialized |
| 388 // before PrefServiceSyncable because PrefServiceSyncable depends on policy | 388 // before PrefServiceSyncable because PrefServiceSyncable depends on policy |
| 389 // loading to get overridden pref values). | 389 // loading to get overridden pref values). |
| 390 #if !defined(OS_CHROMEOS) | 390 #if !defined(OS_CHROMEOS) |
| 391 if (command_line->HasSwitch(switches::kLoadCloudPolicyOnSignin)) { | 391 if (!command_line->HasSwitch(switches::kDisableCloudPolicyOnSignin)) { |
| 392 cloud_policy_manager_ = | 392 cloud_policy_manager_ = |
| 393 policy::UserCloudPolicyManagerFactory::CreateForProfile( | 393 policy::UserCloudPolicyManagerFactory::CreateForProfile( |
| 394 this, force_immediate_policy_load); | 394 this, force_immediate_policy_load); |
| 395 cloud_policy_manager_->Init(); | 395 cloud_policy_manager_->Init(); |
| 396 } | 396 } |
| 397 #endif | 397 #endif |
| 398 managed_mode_policy_provider_ = | 398 managed_mode_policy_provider_ = |
| 399 policy::ManagedModePolicyProvider::Create(this, | 399 policy::ManagedModePolicyProvider::Create(this, |
| 400 sequenced_task_runner, | 400 sequenced_task_runner, |
| 401 force_immediate_policy_load); | 401 force_immediate_policy_load); |
| (...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1166 FilePath* cache_path, | 1166 FilePath* cache_path, |
| 1167 int* max_size) { | 1167 int* max_size) { |
| 1168 DCHECK(cache_path); | 1168 DCHECK(cache_path); |
| 1169 DCHECK(max_size); | 1169 DCHECK(max_size); |
| 1170 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1170 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1171 if (!path.empty()) | 1171 if (!path.empty()) |
| 1172 *cache_path = path; | 1172 *cache_path = path; |
| 1173 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1173 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1174 prefs_->GetInteger(prefs::kDiskCacheSize); | 1174 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1175 } | 1175 } |
| OLD | NEW |