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

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

Issue 548323003: Non-plafrom-specific part of an OwnerSettingsService is moved to components/ownership/*. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes to *.gypi and *.gn files. Created 6 years, 3 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/session_manager_operation.h" 5 #include "chrome/browser/chromeos/settings/session_manager_operation.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 scoped_ptr<em::PolicyData> new_policy) 244 scoped_ptr<em::PolicyData> new_policy)
245 : SessionManagerOperation(callback), 245 : SessionManagerOperation(callback),
246 new_policy_(new_policy.Pass()), 246 new_policy_(new_policy.Pass()),
247 weak_factory_(this) { 247 weak_factory_(this) {
248 DCHECK(new_policy_); 248 DCHECK(new_policy_);
249 } 249 }
250 250
251 SignAndStoreSettingsOperation::~SignAndStoreSettingsOperation() {} 251 SignAndStoreSettingsOperation::~SignAndStoreSettingsOperation() {}
252 252
253 void SignAndStoreSettingsOperation::Run() { 253 void SignAndStoreSettingsOperation::Run() {
254 if (!delegate_) { 254 if (!owner_settings_service_) {
255 ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE); 255 ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE);
256 return; 256 return;
257 } 257 }
258 delegate_->IsOwnerAsync( 258 owner_settings_service_->IsOwnerAsync(
259 base::Bind(&SignAndStoreSettingsOperation::StartSigning, 259 base::Bind(&SignAndStoreSettingsOperation::StartSigning,
260 weak_factory_.GetWeakPtr())); 260 weak_factory_.GetWeakPtr()));
261 } 261 }
262 262
263 void SignAndStoreSettingsOperation::StartSigning(bool is_owner) { 263 void SignAndStoreSettingsOperation::StartSigning(bool is_owner) {
264 if (!delegate_ || !is_owner) { 264 if (!owner_settings_service_ || !is_owner) {
265 ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE); 265 ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE);
266 return; 266 return;
267 } 267 }
268 268
269 bool rv = delegate_->AssembleAndSignPolicyAsync( 269 bool rv = owner_settings_service_->AssembleAndSignPolicyAsync(
270 content::BrowserThread::GetBlockingPool(),
270 new_policy_.Pass(), 271 new_policy_.Pass(),
271 base::Bind(&SignAndStoreSettingsOperation::StoreDeviceSettingsBlob, 272 base::Bind(&SignAndStoreSettingsOperation::StoreDeviceSettingsBlob,
272 weak_factory_.GetWeakPtr())); 273 weak_factory_.GetWeakPtr()));
273 if (!rv) { 274 if (!rv) {
274 ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE); 275 ReportResult(DeviceSettingsService::STORE_KEY_UNAVAILABLE);
275 return; 276 return;
276 } 277 }
277 } 278 }
278 279
279 void SignAndStoreSettingsOperation::StoreDeviceSettingsBlob( 280 void SignAndStoreSettingsOperation::StoreDeviceSettingsBlob(
(...skipping 10 matching lines...) Expand all
290 } 291 }
291 292
292 void SignAndStoreSettingsOperation::HandleStoreResult(bool success) { 293 void SignAndStoreSettingsOperation::HandleStoreResult(bool success) {
293 if (!success) 294 if (!success)
294 ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED); 295 ReportResult(DeviceSettingsService::STORE_OPERATION_FAILED);
295 else 296 else
296 StartLoading(); 297 StartLoading();
297 } 298 }
298 299
299 } // namespace chromeos 300 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698