Index: ui/keyboard/keyboard_util.cc |
diff --git a/ui/keyboard/keyboard_util.cc b/ui/keyboard/keyboard_util.cc |
index e28f6d00fb95851203f9803a4dc777b5d3132a81..9c89e6442b3a4ca5119511cfff249e1b63fdb3f1 100644 |
--- a/ui/keyboard/keyboard_util.cc |
+++ b/ui/keyboard/keyboard_util.cc |
@@ -44,6 +44,9 @@ base::LazyInstance<GURL> g_override_content_url = LAZY_INSTANCE_INITIALIZER; |
bool g_touch_keyboard_enabled = false; |
+keyboard::KeyboardOverscrolOverride g_keyboard_overscroll_override = |
+ keyboard::KEYBOARD_OVERSCROLL_OVERRIDE_NONE; |
+ |
} // namespace |
namespace keyboard { |
@@ -109,10 +112,19 @@ 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 != KEYBOARD_OVERSCROLL_OVERRIDE_NONE) { |
+ return g_keyboard_overscroll_override == |
+ KEYBOARD_OVERSCROLL_OVERRIDE_ENABLED; |
+ } |
+ |
if (CommandLine::ForCurrentProcess()->HasSwitch( |
switches::kDisableVirtualKeyboardOverscroll)) { |
return false; |
@@ -120,6 +132,10 @@ bool IsKeyboardOverscrollEnabled() { |
return true; |
} |
+void SetKeyboardOverscrollOverride(KeyboardOverscrolOverride override) { |
+ g_keyboard_overscroll_override = override; |
+} |
+ |
bool IsInputViewEnabled() { |
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableInputView)) |
return true; |