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

Side by Side Diff: chromeos/dbus/fake_session_manager_client.cc

Issue 2413963002: Replace FOR_EACH_OBSERVER in chromeos/ with range-based for (Closed)
Patch Set: Run the script again with '/mg' 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
« no previous file with comments | « chromeos/dbus/fake_power_manager_client.cc ('k') | chromeos/dbus/fake_shill_device_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chromeos/dbus/fake_session_manager_client.h" 5 #include "chromeos/dbus/fake_session_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 FROM_HERE, 117 FROM_HERE,
118 base::Bind(callback, device_local_account_policy_[account_id])); 118 base::Bind(callback, device_local_account_policy_[account_id]));
119 } 119 }
120 120
121 void FakeSessionManagerClient::StoreDevicePolicy( 121 void FakeSessionManagerClient::StoreDevicePolicy(
122 const std::string& policy_blob, 122 const std::string& policy_blob,
123 const StorePolicyCallback& callback) { 123 const StorePolicyCallback& callback) {
124 device_policy_ = policy_blob; 124 device_policy_ = policy_blob;
125 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 125 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
126 base::Bind(callback, true)); 126 base::Bind(callback, true));
127 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(true)); 127 for (auto& observer : observers_)
128 observer.PropertyChangeComplete(true);
128 } 129 }
129 130
130 void FakeSessionManagerClient::StorePolicyForUser( 131 void FakeSessionManagerClient::StorePolicyForUser(
131 const cryptohome::Identification& cryptohome_id, 132 const cryptohome::Identification& cryptohome_id,
132 const std::string& policy_blob, 133 const std::string& policy_blob,
133 const StorePolicyCallback& callback) { 134 const StorePolicyCallback& callback) {
134 user_policies_[cryptohome_id] = policy_blob; 135 user_policies_[cryptohome_id] = policy_blob;
135 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, 136 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
136 base::Bind(callback, true)); 137 base::Bind(callback, true));
137 } 138 }
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 : base::EmptyString(); 231 : base::EmptyString();
231 } 232 }
232 233
233 void FakeSessionManagerClient::set_device_local_account_policy( 234 void FakeSessionManagerClient::set_device_local_account_policy(
234 const std::string& account_id, 235 const std::string& account_id,
235 const std::string& policy_blob) { 236 const std::string& policy_blob) {
236 device_local_account_policy_[account_id] = policy_blob; 237 device_local_account_policy_[account_id] = policy_blob;
237 } 238 }
238 239
239 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) { 240 void FakeSessionManagerClient::OnPropertyChangeComplete(bool success) {
240 FOR_EACH_OBSERVER(Observer, observers_, PropertyChangeComplete(success)); 241 for (auto& observer : observers_)
242 observer.PropertyChangeComplete(success);
241 } 243 }
242 244
243 } // namespace chromeos 245 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/fake_power_manager_client.cc ('k') | chromeos/dbus/fake_shill_device_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698