| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/pointer_device_observer.h" | 5 #include "chrome/browser/chromeos/system/pointer_device_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "chrome/browser/chromeos/system/input_device_settings.h" | 9 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 weak_factory_.GetWeakPtr())); | 54 weak_factory_.GetWeakPtr())); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void PointerDeviceObserver::CheckMouseExists() { | 57 void PointerDeviceObserver::CheckMouseExists() { |
| 58 InputDeviceSettings::Get()->MouseExists( | 58 InputDeviceSettings::Get()->MouseExists( |
| 59 base::Bind(&PointerDeviceObserver::OnMouseExists, | 59 base::Bind(&PointerDeviceObserver::OnMouseExists, |
| 60 weak_factory_.GetWeakPtr())); | 60 weak_factory_.GetWeakPtr())); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void PointerDeviceObserver::OnTouchpadExists(bool exists) { | 63 void PointerDeviceObserver::OnTouchpadExists(bool exists) { |
| 64 FOR_EACH_OBSERVER(Observer, observers_, TouchpadExists(exists)); | 64 for (auto& observer : observers_) |
| 65 observer.TouchpadExists(exists); |
| 65 } | 66 } |
| 66 | 67 |
| 67 void PointerDeviceObserver::OnMouseExists(bool exists) { | 68 void PointerDeviceObserver::OnMouseExists(bool exists) { |
| 68 FOR_EACH_OBSERVER(Observer, observers_, MouseExists(exists)); | 69 for (auto& observer : observers_) |
| 70 observer.MouseExists(exists); |
| 69 } | 71 } |
| 70 | 72 |
| 71 PointerDeviceObserver::Observer::~Observer() { | 73 PointerDeviceObserver::Observer::~Observer() { |
| 72 } | 74 } |
| 73 | 75 |
| 74 } // namespace system | 76 } // namespace system |
| 75 } // namespace chromeos | 77 } // namespace chromeos |
| OLD | NEW |