Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Side by Side Diff: chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.cc

Issue 519643002: Default values for enterprise users are supported. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test added. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 the store has a verified policy blob received from the server then apply
284 if (store()->has_policy() && 284 // the defaults for policies that haven't been configured by the administrator
285 !policy_map->Get(key::kChromeOsMultiProfileUserBehavior)) { 285 // given that this is an enterprise user.
286 policy_map->Set(key::kChromeOsMultiProfileUserBehavior, 286 if (!store()->has_policy())
287 POLICY_LEVEL_MANDATORY, 287 return;
288 POLICY_SCOPE_USER, 288 SetEnterpriseUsersDefaults(policy_map);
289 new base::StringValue("primary-only"),
290 NULL);
291 }
292 } 289 }
293 290
294 void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() { 291 void UserCloudPolicyManagerChromeOS::FetchPolicyOAuthTokenUsingSigninProfile() {
295 scoped_refptr<net::URLRequestContextGetter> signin_context; 292 scoped_refptr<net::URLRequestContextGetter> signin_context;
296 Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile(); 293 Profile* signin_profile = chromeos::ProfileHelper::GetSigninProfile();
297 if (signin_profile) 294 if (signin_profile)
298 signin_context = signin_profile->GetRequestContext(); 295 signin_context = signin_profile->GetRequestContext();
299 if (!signin_context.get()) { 296 if (!signin_context.get()) {
300 LOG(ERROR) << "No signin Profile for policy oauth token fetch!"; 297 LOG(ERROR) << "No signin Profile for policy oauth token fetch!";
301 OnOAuth2PolicyTokenFetched( 298 OnOAuth2PolicyTokenFetched(
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 // OnComponentCloudPolicyUpdated() once it's ready. 386 // OnComponentCloudPolicyUpdated() once it's ready.
390 return; 387 return;
391 } 388 }
392 389
393 core()->StartRefreshScheduler(); 390 core()->StartRefreshScheduler();
394 core()->TrackRefreshDelayPref(local_state_, 391 core()->TrackRefreshDelayPref(local_state_,
395 policy_prefs::kUserPolicyRefreshRate); 392 policy_prefs::kUserPolicyRefreshRate);
396 } 393 }
397 394
398 } // namespace policy 395 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698