Index: ui/keyboard/keyboard_util.cc |
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc |
index 1d9409be7d2726b73f41525a185293e09beb4f28..3bbe6576d326f4df02034235b9377057c6111570 100644 |
--- a/ui/keyboard/keyboard_util.cc |
+++ b/ui/keyboard/keyboard_util.cc |
@@ -45,6 +45,10 @@ base::LazyInstance<GURL> g_override_content_url = LAZY_INSTANCE_INITIALIZER; |
bool g_touch_keyboard_enabled = false; |
+bool g_keyboard_overscroll_override_enabled = false; |
+ |
+bool g_keyboard_overscroll_enabled_override_value = true; |
kevers
2014/05/21 13:56:11
Feels a bit messy using 2 booleans here. Can we re
Nikita (slow)
2014/05/21 17:21:04
Done.
|
+ |
} // namespace |
namespace keyboard { |
@@ -110,10 +114,17 @@ bool IsKeyboardUsabilityExperimentEnabled() { |
bool IsKeyboardOverscrollEnabled() { |
if (!IsKeyboardEnabled()) |
return false; |
+ |
// Users of the accessibility on-screen keyboard are likely to be using mouse |
// input, which may interfere with overscrolling. |
if (g_accessibility_keyboard_enabled) |
return false; |
+ |
+ // If overscroll enabled override is set, use it instead. Currently |
+ // login / out-of-box disable keyboard overscroll. http://crbug.com/363635 |
+ if (g_keyboard_overscroll_override_enabled) |
+ return g_keyboard_overscroll_enabled_override_value; |
+ |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kDisableVirtualKeyboardOverscroll)) { |
return false; |
@@ -121,6 +132,14 @@ bool IsKeyboardOverscrollEnabled() { |
return true; |
} |
+void SetKeyboardOverscrollEnabledOverrideValue(bool enabled) { |
+ g_keyboard_overscroll_enabled_override_value = enabled; |
+} |
+ |
+void SetKeyboardOverscrollOverrideEnabled(bool enabled) { |
+ g_keyboard_overscroll_override_enabled = enabled; |
+} |
+ |
bool IsInputViewEnabled() { |
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) |
return true; |