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

Unified Diff: ash/virtual_keyboard_controller.cc

Issue 800933002: Turns on smart deployment of the virtual keyboard by default, and changes the flag to allow easy di… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address reviewer feedback. Created 6 years 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
Index: ash/virtual_keyboard_controller.cc
diff --git a/ash/virtual_keyboard_controller.cc b/ash/virtual_keyboard_controller.cc
index 18050cb1b43e1a48d41dad40ea924eac902193dd..f0930a555cc30c35a586bdd4731720b58b7c285b 100644
--- a/ash/virtual_keyboard_controller.cc
+++ b/ash/virtual_keyboard_controller.cc
@@ -36,17 +36,13 @@ VirtualKeyboardController::~VirtualKeyboardController() {
}
void VirtualKeyboardController::OnMaximizeModeStarted() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- keyboard::switches::kAutoVirtualKeyboard)) {
+ if (!IsSmartVirtualKeyboardEnabled())
SetKeyboardEnabled(true);
- }
}
void VirtualKeyboardController::OnMaximizeModeEnded() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- keyboard::switches::kAutoVirtualKeyboard)) {
+ if (!IsSmartVirtualKeyboardEnabled())
SetKeyboardEnabled(false);
- }
}
void VirtualKeyboardController::OnTouchscreenDeviceConfigurationChanged() {
@@ -86,9 +82,13 @@ void VirtualKeyboardController::UpdateDevices() {
UpdateKeyboardEnabled();
}
+bool VirtualKeyboardController::IsSmartVirtualKeyboardEnabled() {
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ keyboard::switches::kDisableSmartVirtualKeyboard);
+}
+
void VirtualKeyboardController::UpdateKeyboardEnabled() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- keyboard::switches::kAutoVirtualKeyboard)) {
+ if (!IsSmartVirtualKeyboardEnabled()) {
SetKeyboardEnabled(Shell::GetInstance()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled());

Powered by Google App Engine
This is Rietveld 408576698