| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/device_settings_provider.h" | 5 #include "chrome/browser/chromeos/device_settings_provider.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 if (IsControlledSetting(path)) | 137 if (IsControlledSetting(path)) |
| 138 SetInPolicy(path, in_value); | 138 SetInPolicy(path, in_value); |
| 139 else | 139 else |
| 140 NOTREACHED() << "Try to set unhandled cros setting " << path; | 140 NOTREACHED() << "Try to set unhandled cros setting " << path; |
| 141 } | 141 } |
| 142 | 142 |
| 143 void DeviceSettingsProvider::Observe( | 143 void DeviceSettingsProvider::Observe( |
| 144 int type, | 144 int type, |
| 145 const content::NotificationSource& source, | 145 const content::NotificationSource& source, |
| 146 const content::NotificationDetails& details) { | 146 const content::NotificationDetails& details) { |
| 147 if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED && | 147 if (type == chrome::NOTIFICATION_OWNER_KEY_FETCH_ATTEMPT_SUCCEEDED) { |
| 148 UserManager::Get()->current_user_is_owner()) { | 148 // Reload the policy blob once the owner key has been loaded or updated. |
| 149 // Reload the initial policy blob, apply settings from temp storage, | |
| 150 // and write back the blob. | |
| 151 ownership_status_ = OwnershipService::OWNERSHIP_TAKEN; | 149 ownership_status_ = OwnershipService::OWNERSHIP_TAKEN; |
| 152 Reload(); | 150 Reload(); |
| 153 } | 151 } |
| 154 } | 152 } |
| 155 | 153 |
| 156 const em::PolicyData DeviceSettingsProvider::policy() const { | 154 const em::PolicyData DeviceSettingsProvider::policy() const { |
| 157 return policy_; | 155 return policy_; |
| 158 } | 156 } |
| 159 | 157 |
| 160 void DeviceSettingsProvider::RetrieveCachedData() { | 158 void DeviceSettingsProvider::RetrieveCachedData() { |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 Reload(); | 516 Reload(); |
| 519 return; | 517 return; |
| 520 } | 518 } |
| 521 LOG(ERROR) << "No retries left"; | 519 LOG(ERROR) << "No retries left"; |
| 522 break; | 520 break; |
| 523 } | 521 } |
| 524 } | 522 } |
| 525 } | 523 } |
| 526 | 524 |
| 527 } // namespace chromeos | 525 } // namespace chromeos |
| OLD | NEW |