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

Side by Side Diff: device/hid/input_service_linux.cc

Issue 2423793002: Remove usage of FOR_EACH_OBSERVER macro in device/ (Closed)
Patch Set: rebase 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 "device/hid/input_service_linux.h" 5 #include "device/hid/input_service_linux.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 DCHECK(CalledOnValidThread()); 234 DCHECK(CalledOnValidThread());
235 DeviceMap::const_iterator it = devices_.find(id); 235 DeviceMap::const_iterator it = devices_.find(id);
236 if (it == devices_.end()) 236 if (it == devices_.end())
237 return false; 237 return false;
238 *info = it->second; 238 *info = it->second;
239 return true; 239 return true;
240 } 240 }
241 241
242 void InputServiceLinux::AddDevice(const InputDeviceInfo& info) { 242 void InputServiceLinux::AddDevice(const InputDeviceInfo& info) {
243 devices_[info.id] = info; 243 devices_[info.id] = info;
244 FOR_EACH_OBSERVER(Observer, observers_, OnInputDeviceAdded(info)); 244 for (auto& observer : observers_)
245 observer.OnInputDeviceAdded(info);
245 } 246 }
246 247
247 void InputServiceLinux::RemoveDevice(const std::string& id) { 248 void InputServiceLinux::RemoveDevice(const std::string& id) {
248 devices_.erase(id); 249 devices_.erase(id);
249 FOR_EACH_OBSERVER(Observer, observers_, OnInputDeviceRemoved(id)); 250 for (auto& observer : observers_)
251 observer.OnInputDeviceRemoved(id);
250 } 252 }
251 253
252 bool InputServiceLinux::CalledOnValidThread() const { 254 bool InputServiceLinux::CalledOnValidThread() const {
253 return thread_checker_.CalledOnValidThread(); 255 return thread_checker_.CalledOnValidThread();
254 } 256 }
255 257
256 } // namespace device 258 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/hid_service.cc ('k') | device/media_transfer_protocol/media_transfer_protocol_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698