| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 31 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 32 #include "components/policy/core/browser/browser_policy_connector.h" | 32 #include "components/policy/core/browser/browser_policy_connector.h" |
| 33 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" | 33 #include "components/policy/core/common/cloud/cloud_external_data_manager.h" |
| 34 #include "components/policy/core/common/cloud/device_management_service.h" | 34 #include "components/policy/core/common/cloud/device_management_service.h" |
| 35 #include "components/user_manager/user.h" | 35 #include "components/user_manager/user.h" |
| 36 #include "components/user_manager/user_manager.h" | 36 #include "components/user_manager/user_manager.h" |
| 37 #include "content/public/browser/browser_thread.h" | 37 #include "content/public/browser/browser_thread.h" |
| 38 #include "net/url_request/url_request_context_getter.h" | 38 #include "net/url_request/url_request_context_getter.h" |
| 39 #include "policy/policy_constants.h" | 39 #include "policy/policy_constants.h" |
| 40 | 40 |
| 41 #include "base/debug/stack_trace.h" |
| 42 |
| 41 namespace policy { | 43 namespace policy { |
| 42 | 44 |
| 43 namespace { | 45 namespace { |
| 44 | 46 |
| 45 // Subdirectory in the user's profile for storing legacy user policies. | 47 // Subdirectory in the user's profile for storing legacy user policies. |
| 46 const base::FilePath::CharType kDeviceManagementDir[] = | 48 const base::FilePath::CharType kDeviceManagementDir[] = |
| 47 FILE_PATH_LITERAL("Device Management"); | 49 FILE_PATH_LITERAL("Device Management"); |
| 48 | 50 |
| 49 // File in the above directory for storing legacy user policy dmtokens. | 51 // File in the above directory for storing legacy user policy dmtokens. |
| 50 const base::FilePath::CharType kToken[] = FILE_PATH_LITERAL("Token"); | 52 const base::FilePath::CharType kToken[] = FILE_PATH_LITERAL("Token"); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // also shared between the incognito Profile and the original Profile. | 112 // also shared between the incognito Profile and the original Profile. |
| 111 ManagerMap::const_iterator it = managers_.find(profile->GetOriginalProfile()); | 113 ManagerMap::const_iterator it = managers_.find(profile->GetOriginalProfile()); |
| 112 return it != managers_.end() ? it->second : NULL; | 114 return it != managers_.end() ? it->second : NULL; |
| 113 } | 115 } |
| 114 | 116 |
| 115 scoped_ptr<UserCloudPolicyManagerChromeOS> | 117 scoped_ptr<UserCloudPolicyManagerChromeOS> |
| 116 UserCloudPolicyManagerFactoryChromeOS::CreateManagerForProfile( | 118 UserCloudPolicyManagerFactoryChromeOS::CreateManagerForProfile( |
| 117 Profile* profile, | 119 Profile* profile, |
| 118 bool force_immediate_load, | 120 bool force_immediate_load, |
| 119 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { | 121 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { |
| 122 // LOG(ERROR) << base::debug::StackTrace().ToString(); |
| 120 const base::CommandLine* command_line = | 123 const base::CommandLine* command_line = |
| 121 base::CommandLine::ForCurrentProcess(); | 124 base::CommandLine::ForCurrentProcess(); |
| 122 // Don't initialize cloud policy for the signin profile. | 125 // Don't initialize cloud policy for the signin profile. |
| 123 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 126 if (chromeos::ProfileHelper::IsSigninProfile(profile)) |
| 124 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); | 127 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); |
| 125 | 128 |
| 126 // |user| should never be NULL except for the signin profile. This object is | 129 // |user| should never be NULL except for the signin profile. This object is |
| 127 // created as part of the Profile creation, which happens right after | 130 // created as part of the Profile creation, which happens right after |
| 128 // sign-in. The just-signed-in User is the active user during that time. | 131 // sign-in. The just-signed-in User is the active user during that time. |
| 129 const user_manager::User* user = | 132 const user_manager::User* user = |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 | 252 |
| 250 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( | 253 bool UserCloudPolicyManagerFactoryChromeOS::HasTestingFactory( |
| 251 content::BrowserContext* context) { | 254 content::BrowserContext* context) { |
| 252 return false; | 255 return false; |
| 253 } | 256 } |
| 254 | 257 |
| 255 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( | 258 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 256 content::BrowserContext* context) {} | 259 content::BrowserContext* context) {} |
| 257 | 260 |
| 258 } // namespace policy | 261 } // namespace policy |
| OLD | NEW |