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

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

Issue 2606773002: Setup Chromad user policy plumbing (Closed)
Patch Set: Address remaining comments Created 3 years, 11 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/location.h" 10 #include "base/location.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 } 126 }
127 127
128 void DeviceSettingsService::Load() { 128 void DeviceSettingsService::Load() {
129 EnqueueLoad(false); 129 EnqueueLoad(false);
130 } 130 }
131 131
132 void DeviceSettingsService::Store( 132 void DeviceSettingsService::Store(
133 std::unique_ptr<em::PolicyFetchResponse> policy, 133 std::unique_ptr<em::PolicyFetchResponse> policy,
134 const base::Closure& callback) { 134 const base::Closure& callback) {
135 // On Active Directory managed devices policy is written only by authpolicyd. 135 // On Active Directory managed devices policy is written only by authpolicyd.
136 CHECK(device_mode_ != policy::DEVICE_MODE_ENTERPRISE_AD); 136 // TODO(tnagel): Re-enable the CHECK.
137 // CHECK(device_mode_ != policy::DEVICE_MODE_ENTERPRISE_AD);
138 LOG(ERROR) << "BAD STORE";
137 Enqueue(linked_ptr<SessionManagerOperation>(new StoreSettingsOperation( 139 Enqueue(linked_ptr<SessionManagerOperation>(new StoreSettingsOperation(
138 base::Bind(&DeviceSettingsService::HandleCompletedOperation, 140 base::Bind(&DeviceSettingsService::HandleCompletedOperation,
139 weak_factory_.GetWeakPtr(), callback), 141 weak_factory_.GetWeakPtr(), callback),
140 std::move(policy)))); 142 std::move(policy))));
141 } 143 }
142 144
143 DeviceSettingsService::OwnershipStatus 145 DeviceSettingsService::OwnershipStatus
144 DeviceSettingsService::GetOwnershipStatus() { 146 DeviceSettingsService::GetOwnershipStatus() {
145 if (public_key_.get()) 147 if (public_key_.get())
146 return public_key_->is_loaded() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE; 148 return public_key_->is_loaded() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE;
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 DeviceSettingsService::Initialize(); 347 DeviceSettingsService::Initialize();
346 } 348 }
347 349
348 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() { 350 ScopedTestDeviceSettingsService::~ScopedTestDeviceSettingsService() {
349 // Clean pending operations. 351 // Clean pending operations.
350 DeviceSettingsService::Get()->UnsetSessionManager(); 352 DeviceSettingsService::Get()->UnsetSessionManager();
351 DeviceSettingsService::Shutdown(); 353 DeviceSettingsService::Shutdown();
352 } 354 }
353 355
354 } // namespace chromeos 356 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698