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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 } | 108 } |
109 | 109 |
110 scoped_refptr<PublicKey> DeviceSettingsService::GetPublicKey() { | 110 scoped_refptr<PublicKey> DeviceSettingsService::GetPublicKey() { |
111 return public_key_; | 111 return public_key_; |
112 } | 112 } |
113 | 113 |
114 void DeviceSettingsService::Load() { | 114 void DeviceSettingsService::Load() { |
115 EnqueueLoad(false); | 115 EnqueueLoad(false); |
116 } | 116 } |
117 | 117 |
118 void DeviceSettingsService::Store(scoped_ptr<em::PolicyFetchResponse> policy, | 118 void DeviceSettingsService::Store( |
119 const base::Closure& callback) { | 119 std::unique_ptr<em::PolicyFetchResponse> policy, |
| 120 const base::Closure& callback) { |
120 Enqueue(linked_ptr<SessionManagerOperation>(new StoreSettingsOperation( | 121 Enqueue(linked_ptr<SessionManagerOperation>(new StoreSettingsOperation( |
121 base::Bind(&DeviceSettingsService::HandleCompletedOperation, | 122 base::Bind(&DeviceSettingsService::HandleCompletedOperation, |
122 weak_factory_.GetWeakPtr(), callback), | 123 weak_factory_.GetWeakPtr(), callback), |
123 std::move(policy)))); | 124 std::move(policy)))); |
124 } | 125 } |
125 | 126 |
126 DeviceSettingsService::OwnershipStatus | 127 DeviceSettingsService::OwnershipStatus |
127 DeviceSettingsService::GetOwnershipStatus() { | 128 DeviceSettingsService::GetOwnershipStatus() { |
128 if (public_key_.get()) | 129 if (public_key_.get()) |
129 return public_key_->is_loaded() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE; | 130 return public_key_->is_loaded() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE; |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 DeviceSettingsService::Initialize(); | 325 DeviceSettingsService::Initialize(); |
325 } | 326 } |
326 | 327 |
327 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { | 328 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { |
328 // Clean pending operations. | 329 // Clean pending operations. |
329 DeviceSettingsService::Get()->UnsetSessionManager(); | 330 DeviceSettingsService::Get()->UnsetSessionManager(); |
330 DeviceSettingsService::Shutdown(); | 331 DeviceSettingsService::Shutdown(); |
331 } | 332 } |
332 | 333 |
333 } // namespace chromeos | 334 } // namespace chromeos |
OLD | NEW |