| 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/settings/device_settings_service.h" | 5 #include "chrome/browser/chromeos/settings/device_settings_service.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 const base::Closure& callback) { | 89 const base::Closure& callback) { |
| 90 Enqueue( | 90 Enqueue( |
| 91 new SignAndStoreSettingsOperation( | 91 new SignAndStoreSettingsOperation( |
| 92 base::Bind(&DeviceSettingsService::HandleCompletedOperation, | 92 base::Bind(&DeviceSettingsService::HandleCompletedOperation, |
| 93 weak_factory_.GetWeakPtr(), | 93 weak_factory_.GetWeakPtr(), |
| 94 callback), | 94 callback), |
| 95 new_settings.Pass(), | 95 new_settings.Pass(), |
| 96 username_)); | 96 username_)); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void DeviceSettingsService::Store(const std::string& policy_blob, | 99 void DeviceSettingsService::Store(scoped_ptr<em::PolicyFetchResponse> policy, |
| 100 const base::Closure& callback) { | 100 const base::Closure& callback) { |
| 101 Enqueue( | 101 Enqueue( |
| 102 new StoreSettingsOperation( | 102 new StoreSettingsOperation( |
| 103 base::Bind(&DeviceSettingsService::HandleCompletedOperation, | 103 base::Bind(&DeviceSettingsService::HandleCompletedOperation, |
| 104 weak_factory_.GetWeakPtr(), | 104 weak_factory_.GetWeakPtr(), |
| 105 callback), | 105 callback), |
| 106 policy_blob)); | 106 policy.Pass())); |
| 107 } | 107 } |
| 108 | 108 |
| 109 DeviceSettingsService::OwnershipStatus | 109 DeviceSettingsService::OwnershipStatus |
| 110 DeviceSettingsService::GetOwnershipStatus() { | 110 DeviceSettingsService::GetOwnershipStatus() { |
| 111 if (owner_key_.get()) | 111 if (owner_key_.get()) |
| 112 return owner_key_->public_key() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE; | 112 return owner_key_->public_key() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE; |
| 113 | 113 |
| 114 return OWNERSHIP_UNKNOWN; | 114 return OWNERSHIP_UNKNOWN; |
| 115 } | 115 } |
| 116 | 116 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 263 |
| 264 // Only remove the pending operation here, so new operations triggered by any | 264 // Only remove the pending operation here, so new operations triggered by any |
| 265 // of the callbacks above are queued up properly. | 265 // of the callbacks above are queued up properly. |
| 266 pending_operations_.pop_front(); | 266 pending_operations_.pop_front(); |
| 267 delete operation; | 267 delete operation; |
| 268 | 268 |
| 269 StartNextOperation(); | 269 StartNextOperation(); |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace chromeos | 272 } // namespace chromeos |
| OLD | NEW |