Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: ash/virtual_keyboard_controller.h

Issue 613343005: Automatic deployment of the virtual keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.cc ('k') | ash/virtual_keyboard_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/virtual_keyboard_controller.h
diff --git a/ash/virtual_keyboard_controller.h b/ash/virtual_keyboard_controller.h
index b2788ccd76ed16ccd6a22b0af4bb80a181b8834e..c32bdb0cc65237fc0f95fb0d5441c767da0e3c35 100644
--- a/ash/virtual_keyboard_controller.h
+++ b/ash/virtual_keyboard_controller.h
@@ -7,20 +7,44 @@
#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();
~VirtualKeyboardController() override;
// ShellObserver:
- void OnMaximizeModeStarted() override;
- void OnMaximizeModeEnded() override;
+ 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.
+ 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);
};
« no previous file with comments | « ash/shell.cc ('k') | ash/virtual_keyboard_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698