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. |
| 17 virtual void DeviceAdded(int device_id) = 0; |
| 18 |
| 19 // Called when a key either on a built-in keyboard or external one is pressed. |
| 20 // |device_id| is the source of the key event which will be sent to the Chrome |
| 21 // window shortly. |
| 22 virtual void KeyPressedOrReleased(int device_id) = 0; |
| 23 |
16 protected: | 24 protected: |
17 virtual ~DeviceHierarchyObserver() {} | 25 virtual ~DeviceHierarchyObserver() {} |
18 }; | 26 }; |
19 | 27 |
20 } // namespace chromeos | 28 } // namespace chromeos |
21 | 29 |
22 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ | 30 #endif // CHROME_BROWSER_CHROMEOS_DEVICE_HIERARCHY_OBSERVER_H_ |
OLD | NEW |