Index: ui/keyboard/keyboard_util.cc |
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc |
index ebc987ffa3aaf86038bb39206293f230f0d0a0a7..58b8f37651957a5851fbd196d80b90ab414adf48 100644 |
--- a/ui/keyboard/keyboard_util.cc |
+++ b/ui/keyboard/keyboard_util.cc |
@@ -47,6 +47,9 @@ bool g_touch_keyboard_enabled = false; |
keyboard::KeyboardOverscrolOverride g_keyboard_overscroll_override = |
keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_NONE; |
+keyboard::KeyboardShowOverride g_keyboard_show_override = |
bartfab (slow)
2014/06/16 10:20:13
Nit: Should this be in an #ifdef? It is not used o
rsadam
2014/06/16 13:45:35
Tthe virtual keyboard is only ever created on CHRO
bartfab (slow)
2014/06/16 14:14:02
I see nothing in the gyp files excluding this file
|
+ keyboard::KEYBOARD_SHOW_OVERRIDE_NONE; |
+ |
} // namespace |
namespace keyboard { |
@@ -97,11 +100,17 @@ std::string GetKeyboardLayout() { |
} |
bool IsKeyboardEnabled() { |
- return g_accessibility_keyboard_enabled || |
- CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kEnableVirtualKeyboard) || |
- IsKeyboardUsabilityExperimentEnabled() || |
- g_touch_keyboard_enabled; |
+ // Accessibility setting prioritized over policy setting. |
+ if (g_accessibility_keyboard_enabled) |
bartfab (slow)
2014/06/16 10:20:13
Could you check whether this can be used to overri
rsadam
2014/06/16 13:45:34
The keyboard only shows on text input focus - but
|
+ return true; |
+ // Policy strictly disables showing a virtual keyboard. |
+ if (g_keyboard_show_override == keyboard::KEYBOARD_SHOW_OVERRIDE_DISABLED) |
+ return false; |
+ // Check if any of the flags are enabled. |
+ return CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableVirtualKeyboard) || |
+ IsKeyboardUsabilityExperimentEnabled() || g_touch_keyboard_enabled || |
bartfab (slow)
2014/06/16 10:20:13
Nit: Could you reformat this so there is one condi
rsadam
2014/06/16 13:45:34
Done.
|
+ (g_keyboard_show_override == keyboard::KEYBOARD_SHOW_OVERRIDE_ENABLED); |
} |
bool IsKeyboardUsabilityExperimentEnabled() { |
@@ -136,6 +145,10 @@ void SetKeyboardOverscrollOverride(KeyboardOverscrolOverride override) { |
g_keyboard_overscroll_override = override; |
} |
+void SetKeyboardShowOverride(KeyboardShowOverride override) { |
+ g_keyboard_show_override = override; |
+} |
+ |
bool IsInputViewEnabled() { |
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) |
return true; |