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/policy/device_cloud_policy_store_chromeos.h" | 5 #include "chrome/browser/policy/device_cloud_policy_store_chromeos.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/policy/device_policy_decoder_chromeos.h" | 8 #include "chrome/browser/policy/device_policy_decoder_chromeos.h" |
9 #include "chrome/browser/policy/enterprise_install_attributes.h" | 9 #include "chrome/browser/policy/enterprise_install_attributes.h" |
10 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" | 10 #include "chrome/browser/policy/proto/chrome_device_policy.pb.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 device_settings_service_->policy_data(), false); | 48 device_settings_service_->policy_data(), false); |
49 validator.release()->StartValidation( | 49 validator.release()->StartValidation( |
50 base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, | 50 base::Bind(&DeviceCloudPolicyStoreChromeOS::OnPolicyToStoreValidated, |
51 weak_factory_.GetWeakPtr())); | 51 weak_factory_.GetWeakPtr())); |
52 } | 52 } |
53 | 53 |
54 void DeviceCloudPolicyStoreChromeOS::Load() { | 54 void DeviceCloudPolicyStoreChromeOS::Load() { |
55 device_settings_service_->Load(); | 55 device_settings_service_->Load(); |
56 } | 56 } |
57 | 57 |
58 void DeviceCloudPolicyStoreChromeOS::RemoveStoredPolicy() { | |
59 // Device policy cannot and should not be removed on Chrome OS. | |
60 NOTREACHED(); | |
61 } | |
Andrew T Wilson (Slow)
2012/11/21 17:34:24
YAY for getting rid of this hack.
Mattias Nissler (ping if slow)
2012/11/22 20:51:59
At a considerable price, but yes.
| |
62 | |
63 void DeviceCloudPolicyStoreChromeOS::InstallInitialPolicy( | 58 void DeviceCloudPolicyStoreChromeOS::InstallInitialPolicy( |
64 const em::PolicyFetchResponse& policy) { | 59 const em::PolicyFetchResponse& policy) { |
65 // Cancel all pending requests. | 60 // Cancel all pending requests. |
66 weak_factory_.InvalidateWeakPtrs(); | 61 weak_factory_.InvalidateWeakPtrs(); |
67 | 62 |
68 if (!install_attributes_->IsEnterpriseDevice() && | 63 if (!install_attributes_->IsEnterpriseDevice() && |
69 device_settings_service_->status() != | 64 device_settings_service_->status() != |
70 chromeos::DeviceSettingsService::STORE_NO_POLICY) { | 65 chromeos::DeviceSettingsService::STORE_NO_POLICY) { |
71 status_ = STATUS_BAD_STATE; | 66 status_ = STATUS_BAD_STATE; |
72 NotifyStoreError(); | 67 NotifyStoreError(); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: | 152 case chromeos::DeviceSettingsService::STORE_VALIDATION_ERROR: |
158 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: | 153 case chromeos::DeviceSettingsService::STORE_TEMP_VALIDATION_ERROR: |
159 status_ = STATUS_LOAD_ERROR; | 154 status_ = STATUS_LOAD_ERROR; |
160 break; | 155 break; |
161 } | 156 } |
162 | 157 |
163 NotifyStoreError(); | 158 NotifyStoreError(); |
164 } | 159 } |
165 | 160 |
166 } // namespace policy | 161 } // namespace policy |
OLD | NEW |