| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 return it != managers_.end() ? it->second : NULL; | 101 return it != managers_.end() ? it->second : NULL; |
| 102 } | 102 } |
| 103 | 103 |
| 104 scoped_ptr<UserCloudPolicyManagerChromeOS> | 104 scoped_ptr<UserCloudPolicyManagerChromeOS> |
| 105 UserCloudPolicyManagerFactoryChromeOS::CreateManagerForProfile( | 105 UserCloudPolicyManagerFactoryChromeOS::CreateManagerForProfile( |
| 106 Profile* profile, | 106 Profile* profile, |
| 107 bool force_immediate_load, | 107 bool force_immediate_load, |
| 108 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { | 108 scoped_refptr<base::SequencedTaskRunner> background_task_runner) { |
| 109 const CommandLine* command_line = CommandLine::ForCurrentProcess(); | 109 const CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 110 // Don't initialize cloud policy for the signin profile. | 110 // Don't initialize cloud policy for the signin profile. |
| 111 if (chromeos::ProfileHelper::IsSigninProfile(profile)) | 111 if (profile->IsLoginProfile()) |
| 112 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); | 112 return scoped_ptr<UserCloudPolicyManagerChromeOS>(); |
| 113 | 113 |
| 114 // |user| should never be NULL except for the signin profile. This object is | 114 // |user| should never be NULL except for the signin profile. This object is |
| 115 // created as part of the Profile creation, which happens right after | 115 // created as part of the Profile creation, which happens right after |
| 116 // sign-in. The just-signed-in User is the active user during that time. | 116 // sign-in. The just-signed-in User is the active user during that time. |
| 117 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); | 117 chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
| 118 chromeos::User* user = user_manager->GetUserByProfile(profile); | 118 chromeos::User* user = user_manager->GetUserByProfile(profile); |
| 119 CHECK(user); | 119 CHECK(user); |
| 120 | 120 |
| 121 // Only USER_TYPE_REGULAR users have user cloud policy. | 121 // Only USER_TYPE_REGULAR users have user cloud policy. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); | 221 BrowserContextKeyedBaseFactory::BrowserContextDestroyed(context); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( | 224 void UserCloudPolicyManagerFactoryChromeOS::SetEmptyTestingFactory( |
| 225 content::BrowserContext* context) {} | 225 content::BrowserContext* context) {} |
| 226 | 226 |
| 227 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( | 227 void UserCloudPolicyManagerFactoryChromeOS::CreateServiceNow( |
| 228 content::BrowserContext* context) {} | 228 content::BrowserContext* context) {} |
| 229 | 229 |
| 230 } // namespace policy | 230 } // namespace policy |
| OLD | NEW |