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 #ifndef ASH_VIRTUAL_KEYBOARD_CONTROLLER_H_ | 5 #ifndef ASH_VIRTUAL_KEYBOARD_CONTROLLER_H_ |
6 #define ASH_VIRTUAL_KEYBOARD_CONTROLLER_H_ | 6 #define ASH_VIRTUAL_KEYBOARD_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
10 #include "ui/events/input_device_event_observer.h" | |
10 | 11 |
11 namespace ash { | 12 namespace ash { |
12 | 13 |
13 // This class observes enter/leaving maximized mode for virtual keyboard. | 14 // This class observes input device changes for the virtual keyboard. |
14 class ASH_EXPORT VirtualKeyboardController : public ShellObserver { | 15 class ASH_EXPORT VirtualKeyboardController |
16 : public ShellObserver, | |
17 public ui::InputDeviceEventObserver { | |
15 public: | 18 public: |
16 VirtualKeyboardController(); | 19 VirtualKeyboardController(); |
17 virtual ~VirtualKeyboardController(); | 20 virtual ~VirtualKeyboardController(); |
18 | 21 |
19 // ShellObserver: | 22 // ShellObserver: |
20 virtual void OnMaximizeModeStarted() override; | 23 virtual void OnMaximizeModeStarted() override; |
21 virtual void OnMaximizeModeEnded() override; | 24 virtual void OnMaximizeModeEnded() override; |
22 | 25 |
26 // ui::InputDeviceObserver: | |
27 // TODO(rsadam@): Remove when autovirtual keyboard flag is on by default. | |
28 virtual void OnTouchscreenDeviceConfigurationChanged() override; | |
29 virtual void OnKeyboardDeviceConfigurationChanged() override; | |
30 | |
23 private: | 31 private: |
32 // Updates the list of active input devices. | |
33 void UpdateDevices(); | |
34 // Updates the keyboard state. | |
sky
2014/10/27 20:28:33
nit: add newlines between functions for improved r
rsadam
2014/10/28 15:07:29
Done.
| |
35 void UpdateKeyboardEnabled(); | |
36 // Creates the keyboard if |enabled|, else destroys it. | |
37 void SetKeyboardEnabled(bool enabled); | |
38 | |
39 // True if an external keyboard is connected. | |
40 bool has_external_keyboard_; | |
41 // True if an internal keyboard is connected. | |
42 bool has_internal_keyboard_; | |
43 // True if a touchscreen is connected. | |
44 bool has_touchscreen_; | |
45 | |
24 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardController); | 46 DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardController); |
25 }; | 47 }; |
26 | 48 |
27 } // namespace ash | 49 } // namespace ash |
28 | 50 |
29 #endif // ASH_VIRTUAL_KEYBOARD_CONTROLLER_H_ | 51 #endif // ASH_VIRTUAL_KEYBOARD_CONTROLLER_H_ |
OLD | NEW |