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; | |
Daniel Erat
2012/03/27 16:19:35
do you also need a DeviceRemoved() method?
Daniel Erat
2012/03/31 01:24:08
Done.
| |
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; | |
Daniel Erat
2012/03/27 16:19:35
nit: rename to DeviceKeyPressedOrReleased() so the
Daniel Erat
2012/03/31 01:24:08
Done.
| |
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 |