| OLD | NEW |
| 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/device/input_service_proxy.h" | 5 #include "chrome/browser/chromeos/device/input_service_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/task_runner_util.h" | 9 #include "base/task_runner_util.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 139 } |
| 140 | 140 |
| 141 // static | 141 // static |
| 142 void InputServiceProxy::SetThreadIdForTesting(BrowserThread::ID thread_id) { | 142 void InputServiceProxy::SetThreadIdForTesting(BrowserThread::ID thread_id) { |
| 143 InputServiceProxy::thread_identifier_ = thread_id; | 143 InputServiceProxy::thread_identifier_ = thread_id; |
| 144 } | 144 } |
| 145 | 145 |
| 146 void InputServiceProxy::OnDeviceAdded( | 146 void InputServiceProxy::OnDeviceAdded( |
| 147 const InputServiceLinux::InputDeviceInfo& info) { | 147 const InputServiceLinux::InputDeviceInfo& info) { |
| 148 DCHECK(thread_checker_.CalledOnValidThread()); | 148 DCHECK(thread_checker_.CalledOnValidThread()); |
| 149 FOR_EACH_OBSERVER(Observer, observers_, OnInputDeviceAdded(info)); | 149 for (auto& observer : observers_) |
| 150 observer.OnInputDeviceAdded(info); |
| 150 } | 151 } |
| 151 | 152 |
| 152 void InputServiceProxy::OnDeviceRemoved(const std::string& id) { | 153 void InputServiceProxy::OnDeviceRemoved(const std::string& id) { |
| 153 DCHECK(thread_checker_.CalledOnValidThread()); | 154 DCHECK(thread_checker_.CalledOnValidThread()); |
| 154 FOR_EACH_OBSERVER(Observer, observers_, OnInputDeviceRemoved(id)); | 155 for (auto& observer : observers_) |
| 156 observer.OnInputDeviceRemoved(id); |
| 155 } | 157 } |
| 156 | 158 |
| 157 } // namespace chromeos | 159 } // namespace chromeos |
| OLD | NEW |