OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 namespace chromeos { | 9 namespace chromeos { |
10 | 10 |
11 // Observers receive notifications when a device has been added/removed. | 11 // Observers receive notifications when a device has been added/removed. |
12 class DeviceHierarchyObserver { | 12 class DeviceHierarchyObserver { |
13 public: | 13 public: |
14 virtual void DeviceHierarchyChanged() = 0; | 14 virtual void DeviceHierarchyChanged() = 0; |
15 | 15 |
| 16 // Called when a new device (e.g. an external USB keyboard) is attached or |
| 17 // detached. |
| 18 virtual void DeviceAdded(int device_id) = 0; |
| 19 virtual void DeviceRemoved(int device_id) = 0; |
| 20 |
| 21 // Called when a key on either a built-in keyboard or an external one is |
| 22 // pressed. |device_id| is the source of the key event which will be sent to |
| 23 // the Chrome window shortly. |
| 24 virtual void DeviceKeyPressedOrReleased(int device_id) = 0; |
| 25 |
16 protected: | 26 protected: |
17 virtual ~DeviceHierarchyObserver() {} | 27 virtual ~DeviceHierarchyObserver() {} |
18 }; | 28 }; |
19 | 29 |
20 } // namespace chromeos | 30 } // namespace chromeos |
21 | 31 |
22 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ | 32 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ |
OLD | NEW |