| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/login_profile_policy_provider.h" | 5 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace | 86 } // namespace |
| 87 | 87 |
| 88 LoginProfilePolicyProvider::LoginProfilePolicyProvider( | 88 LoginProfilePolicyProvider::LoginProfilePolicyProvider( |
| 89 PolicyService* device_policy_service) | 89 PolicyService* device_policy_service) |
| 90 : device_policy_service_(device_policy_service), | 90 : device_policy_service_(device_policy_service), |
| 91 waiting_for_device_policy_refresh_(false), | 91 waiting_for_device_policy_refresh_(false), |
| 92 weak_factory_(this) { | 92 weak_factory_(this) { |
| 93 // All Chrome OS policies are coming from the cloud. |
| 94 source_ = POLICY_SOURCE_CLOUD; |
| 93 } | 95 } |
| 94 | 96 |
| 95 LoginProfilePolicyProvider::~LoginProfilePolicyProvider() { | 97 LoginProfilePolicyProvider::~LoginProfilePolicyProvider() { |
| 96 } | 98 } |
| 97 | 99 |
| 98 void LoginProfilePolicyProvider::Init(SchemaRegistry* registry) { | 100 void LoginProfilePolicyProvider::Init(SchemaRegistry* registry) { |
| 99 ConfigurationPolicyProvider::Init(registry); | 101 ConfigurationPolicyProvider::Init(registry); |
| 100 device_policy_service_->AddObserver(POLICY_DOMAIN_CHROME, this); | 102 device_policy_service_->AddObserver(POLICY_DOMAIN_CHROME, this); |
| 101 if (device_policy_service_->IsInitializationComplete(POLICY_DOMAIN_CHROME)) | 103 if (device_policy_service_->IsInitializationComplete(POLICY_DOMAIN_CHROME)) |
| 102 UpdateFromDevicePolicy(); | 104 UpdateFromDevicePolicy(); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 ApplyValueAsMandatoryPolicy(policy_value.get(), | 199 ApplyValueAsMandatoryPolicy(policy_value.get(), |
| 198 key::kPowerManagementIdleSettings, | 200 key::kPowerManagementIdleSettings, |
| 199 &user_policy_map); | 201 &user_policy_map); |
| 200 } | 202 } |
| 201 } | 203 } |
| 202 | 204 |
| 203 UpdatePolicy(bundle.Pass()); | 205 UpdatePolicy(bundle.Pass()); |
| 204 } | 206 } |
| 205 | 207 |
| 206 } // namespace policy | 208 } // namespace policy |
| OLD | NEW |