Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Side by Side Diff: chrome/browser/chromeos/settings/device_settings_service.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698