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

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: Move to anon. 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..a0781575e2e5641c858f31b80d019db548c7c62b 100644
--- a/ash/virtual_keyboard_controller.cc
+++ b/ash/virtual_keyboard_controller.cc
@@ -19,6 +19,15 @@
#include "ui/keyboard/keyboard_util.h"
namespace ash {
+namespace {
+
+// Checks whether smart deployment is enabled.
+bool IsSmartVirtualKeyboardEnabled() {
+ return !CommandLine::ForCurrentProcess()->HasSwitch(
+ keyboard::switches::kDisableSmartVirtualKeyboard);
+}
+
+} // namespace
VirtualKeyboardController::VirtualKeyboardController()
: has_external_keyboard_(false),
@@ -36,17 +45,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() {
@@ -87,8 +92,7 @@ void VirtualKeyboardController::UpdateDevices() {
}
void VirtualKeyboardController::UpdateKeyboardEnabled() {
- if (!CommandLine::ForCurrentProcess()->HasSwitch(
- keyboard::switches::kAutoVirtualKeyboard)) {
+ if (!IsSmartVirtualKeyboardEnabled()) {
SetKeyboardEnabled(Shell::GetInstance()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled());
« no previous file with comments | « ash/system/chromeos/virtual_keyboard/tray_keyboard_lock_unittest.cc ('k') | ash/virtual_keyboard_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698