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

Side by Side Diff: chrome/browser/chromeos/system/device_disabling_manager.cc

Issue 2416763002: Replace FOR_EACH_OBSERVER in c/b/chromeos with range-based for (Closed)
Patch Set: Created 4 years, 2 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 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/system/device_disabling_manager.h" 5 #include "chrome/browser/chromeos/system/device_disabling_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 UpdateFromCrosSettings(); 77 UpdateFromCrosSettings();
78 } 78 }
79 79
80 void DeviceDisablingManager::CacheDisabledMessageAndNotify( 80 void DeviceDisablingManager::CacheDisabledMessageAndNotify(
81 const std::string& disabled_message) { 81 const std::string& disabled_message) {
82 if (disabled_message == disabled_message_) 82 if (disabled_message == disabled_message_)
83 return; 83 return;
84 84
85 disabled_message_ = disabled_message; 85 disabled_message_ = disabled_message;
86 FOR_EACH_OBSERVER(Observer, 86 for (auto& observer : observers_)
87 observers_, 87 observer.OnDisabledMessageChanged(disabled_message_);
88 OnDisabledMessageChanged(disabled_message_));
89 } 88 }
90 89
91 void DeviceDisablingManager::CheckWhetherDeviceDisabledDuringOOBE( 90 void DeviceDisablingManager::CheckWhetherDeviceDisabledDuringOOBE(
92 const DeviceDisabledCheckCallback& callback) { 91 const DeviceDisabledCheckCallback& callback) {
93 if (policy::GetRestoreMode() != policy::RESTORE_MODE_DISABLED || 92 if (policy::GetRestoreMode() != policy::RESTORE_MODE_DISABLED ||
94 base::CommandLine::ForCurrentProcess()->HasSwitch( 93 base::CommandLine::ForCurrentProcess()->HasSwitch(
95 switches::kDisableDeviceDisabling)) { 94 switches::kDisableDeviceDisabling)) {
96 // Indicate that the device is not disabled if it is not marked as such in 95 // Indicate that the device is not disabled if it is not marked as such in
97 // local state or device disabling has been turned off by flag. 96 // local state or device disabling has been turned off by flag.
98 callback.Run(false); 97 callback.Run(false);
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 219
221 // Cache the enrollment domain. 220 // Cache the enrollment domain.
222 enrollment_domain_ = browser_policy_connector_->GetEnterpriseDomain(); 221 enrollment_domain_ = browser_policy_connector_->GetEnterpriseDomain();
223 222
224 // If no session or login is in progress, show the device disabled screen. 223 // If no session or login is in progress, show the device disabled screen.
225 delegate_->ShowDeviceDisabledScreen(); 224 delegate_->ShowDeviceDisabledScreen();
226 } 225 }
227 226
228 } // namespace system 227 } // namespace system
229 } // namespace chromeos 228 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/system/automatic_reboot_manager.cc ('k') | chrome/browser/chromeos/system/pointer_device_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698