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

Side by Side Diff: chrome/browser/chromeos/policy/consumer_management_service.cc

Issue 733613005: Move the notification part out of ConsumerEnrollmentHandler so that it can be reused for unenrollme… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enroll
Patch Set: Added a check for UserManager. Created 6 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/policy/consumer_management_service.h" 5 #include "chrome/browser/chromeos/policy/consumer_management_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_registry_simple.h" 10 #include "base/prefs/pref_registry_simple.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 } 144 }
145 145
146 void ConsumerManagementService::DeviceSettingsUpdated() { 146 void ConsumerManagementService::DeviceSettingsUpdated() {
147 NotifyStatusChanged(); 147 NotifyStatusChanged();
148 } 148 }
149 149
150 void ConsumerManagementService::OnDeviceSettingsServiceShutdown() { 150 void ConsumerManagementService::OnDeviceSettingsServiceShutdown() {
151 device_settings_service_ = nullptr; 151 device_settings_service_ = nullptr;
152 } 152 }
153 153
154 void ConsumerManagementService::NotifyStatusChanged() {
155 FOR_EACH_OBSERVER(Observer, observers_, OnConsumerManagementStatusChanged());
156 }
157
154 void ConsumerManagementService::OnGetBootAttributeDone( 158 void ConsumerManagementService::OnGetBootAttributeDone(
155 const GetOwnerCallback& callback, 159 const GetOwnerCallback& callback,
156 chromeos::DBusMethodCallStatus call_status, 160 chromeos::DBusMethodCallStatus call_status,
157 bool dbus_success, 161 bool dbus_success,
158 const cryptohome::BaseReply& reply) { 162 const cryptohome::BaseReply& reply) {
159 if (!dbus_success || reply.error() != 0) { 163 if (!dbus_success || reply.error() != 0) {
160 LOG(ERROR) << "Failed to get the owner info from boot lockbox."; 164 LOG(ERROR) << "Failed to get the owner info from boot lockbox.";
161 callback.Run(""); 165 callback.Run("");
162 return; 166 return;
163 } 167 }
(...skipping 28 matching lines...) Expand all
192 const cryptohome::BaseReply& reply) { 196 const cryptohome::BaseReply& reply) {
193 if (!dbus_success || reply.error() != 0) { 197 if (!dbus_success || reply.error() != 0) {
194 LOG(ERROR) << "Failed to flush and sign boot lockbox."; 198 LOG(ERROR) << "Failed to flush and sign boot lockbox.";
195 callback.Run(false); 199 callback.Run(false);
196 return; 200 return;
197 } 201 }
198 202
199 callback.Run(true); 203 callback.Run(true);
200 } 204 }
201 205
202 void ConsumerManagementService::NotifyStatusChanged() {
203 FOR_EACH_OBSERVER(Observer, observers_, OnConsumerManagementStatusChanged());
204 }
205
206 } // namespace policy 206 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698