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/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 } | 273 } |
274 | 274 |
275 void UserCloudPolicyManagerChromeOS::OnComponentCloudPolicyUpdated() { | 275 void UserCloudPolicyManagerChromeOS::OnComponentCloudPolicyUpdated() { |
276 CloudPolicyManager::OnComponentCloudPolicyUpdated(); | 276 CloudPolicyManager::OnComponentCloudPolicyUpdated(); |
277 StartRefreshSchedulerIfReady(); | 277 StartRefreshSchedulerIfReady(); |
278 } | 278 } |
279 | 279 |
280 void UserCloudPolicyManagerChromeOS::GetChromePolicy(PolicyMap* policy_map) { | 280 void UserCloudPolicyManagerChromeOS::GetChromePolicy(PolicyMap* policy_map) { |
281 CloudPolicyManager::GetChromePolicy(policy_map); | 281 CloudPolicyManager::GetChromePolicy(policy_map); |
282 | 282 |
283 // Default multi-profile behavior for managed accounts to primary-only. | 283 if (!store()->has_policy()) |
284 if (store()->has_policy() && | 284 return; |
285 !policy_map->Get(key::kChromeOsMultiProfileUserBehavior)) { | 285 |
286 policy_map->Set(key::kChromeOsMultiProfileUserBehavior, | 286 SetEnterpriseUsersDefaults(policy_map); |
Joao da Silva
2014/08/29 09:11:42
Add a comment here explaining what we're doing. Su
merkulova
2014/08/29 14:02:52
Done.
| |
287 POLICY_LEVEL_MANDATORY, | |
288 POLICY_SCOPE_USER, | |
289 new base::StringValue("primary-only"), | |
290 NULL); | |
291 } | |
292 } | 287 } |
293 | 288 |
294 void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() { | 289 void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() { |
295 scoped_refptr<net::URLRequestContextGetter> signin_context; | 290 scoped_refptr<net::URLRequestContextGetter> signin_context; |
296 Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile(); | 291 Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile(); |
297 if (signin_profile) | 292 if (signin_profile) |
298 signin_context = signin_profile->GetRequestContext(); | 293 signin_context = signin_profile->GetRequestContext(); |
299 if (!signin_context.get()) { | 294 if (!signin_context.get()) { |
300 LOG(ERROR) << "No signin Profile for policy oauth token fetch!"; | 295 LOG(ERROR) << "No signin Profile for policy oauth token fetch!"; |
301 OnOAuth2PolicyTokenFetched( | 296 OnOAuth2PolicyTokenFetched( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
389 // OnComponentCloudPolicyUpdated() once it's ready. | 384 // OnComponentCloudPolicyUpdated() once it's ready. |
390 return; | 385 return; |
391 } | 386 } |
392 | 387 |
393 core()->StartRefreshScheduler(); | 388 core()->StartRefreshScheduler(); |
394 core()->TrackRefreshDelayPref(local_state_, | 389 core()->TrackRefreshDelayPref(local_state_, |
395 policy_prefs::kUserPolicyRefreshRate); | 390 policy_prefs::kUserPolicyRefreshRate); |
396 } | 391 } |
397 | 392 |
398 } // namespace policy | 393 } // namespace policy |
OLD | NEW |