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

Side by Side Diff: ui/events/ozone/device/device_manager_manual.cc

Issue 2422073002: Reduce FOR_EACH_OBSERVER usage in ui/ (Closed)
Patch Set: remove space 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 "ui/events/ozone/device/device_manager_manual.h" 5 #include "ui/events/ozone/device/device_manager_manual.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/files/file_enumerator.h" 9 #include "base/files/file_enumerator.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 void DeviceManagerManual::RemoveObserver(DeviceEventObserver* observer) { 59 void DeviceManagerManual::RemoveObserver(DeviceEventObserver* observer) {
60 observers_.RemoveObserver(observer); 60 observers_.RemoveObserver(observer);
61 } 61 }
62 62
63 void DeviceManagerManual::OnDevicesScanned( 63 void DeviceManagerManual::OnDevicesScanned(
64 std::vector<base::FilePath>* result) { 64 std::vector<base::FilePath>* result) {
65 std::vector<base::FilePath>::const_iterator it = result->begin(); 65 std::vector<base::FilePath>::const_iterator it = result->begin();
66 for (; it != result->end(); ++it) { 66 for (; it != result->end(); ++it) {
67 devices_.push_back(*it); 67 devices_.push_back(*it);
68 DeviceEvent event(DeviceEvent::INPUT, DeviceEvent::ADD, *it); 68 DeviceEvent event(DeviceEvent::INPUT, DeviceEvent::ADD, *it);
69 FOR_EACH_OBSERVER(DeviceEventObserver, observers_, OnDeviceEvent(event)); 69 for (DeviceEventObserver& observer : observers_)
70 observer.OnDeviceEvent(event);
70 } 71 }
71 } 72 }
72 73
73 } // namespace ui 74 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/devices/device_data_manager.cc ('k') | ui/events/ozone/device/udev/device_manager_udev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698