Index: ash/virtual_keyboard_controller.h |
diff --git a/ash/virtual_keyboard_controller.h b/ash/virtual_keyboard_controller.h |
index ebbc0fde1858a41f2e32c56d971f967ee831eed1..8cb5ff26e5a2314e39b796b26220487f76a0e2f7 100644 |
--- a/ash/virtual_keyboard_controller.h |
+++ b/ash/virtual_keyboard_controller.h |
@@ -7,11 +7,14 @@ |
#include "ash/ash_export.h" |
#include "ash/shell_observer.h" |
+#include "ui/events/input_device_event_observer.h" |
namespace ash { |
-// This class observes enter/leaving maximized mode for virtual keyboard. |
-class ASH_EXPORT VirtualKeyboardController : public ShellObserver { |
+// This class observes input device changes for the virtual keyboard. |
+class ASH_EXPORT VirtualKeyboardController |
+ : public ShellObserver, |
+ public ui::InputDeviceEventObserver { |
public: |
VirtualKeyboardController(); |
virtual ~VirtualKeyboardController(); |
@@ -20,7 +23,26 @@ class ASH_EXPORT VirtualKeyboardController : public ShellObserver { |
virtual void OnMaximizeModeStarted() override; |
virtual void OnMaximizeModeEnded() override; |
+ // ui::InputDeviceObserver: |
+ // TODO(rsadam@): Remove when autovirtual keyboard flag is on by default. |
+ virtual void OnTouchscreenDeviceConfigurationChanged() override; |
+ virtual void OnKeyboardDeviceConfigurationChanged() override; |
+ |
private: |
+ // Updates the list of active input devices. |
+ void UpdateDevices(); |
+ // 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.
|
+ void UpdateKeyboardEnabled(); |
+ // Creates the keyboard if |enabled|, else destroys it. |
+ void SetKeyboardEnabled(bool enabled); |
+ |
+ // True if an external keyboard is connected. |
+ bool has_external_keyboard_; |
+ // True if an internal keyboard is connected. |
+ bool has_internal_keyboard_; |
+ // True if a touchscreen is connected. |
+ bool has_touchscreen_; |
+ |
DISALLOW_COPY_AND_ASSIGN(VirtualKeyboardController); |
}; |