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

Unified Diff: ui/keyboard/keyboard_controller.cc

Issue 131143005: Keyboard height ratio for a11y keyboard. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge with master. Created 6 years, 11 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/keyboard_controller.cc
diff --git a/ui/keyboard/keyboard_controller.cc b/ui/keyboard/keyboard_controller.cc
index 764b55266c1ebb8c3e6e1ba1e32a0d607c1b0666..668a8fd6041e85bfb0af3ba6a145fa7d38e372f3 100644
--- a/ui/keyboard/keyboard_controller.cc
+++ b/ui/keyboard/keyboard_controller.cc
@@ -36,9 +36,16 @@ const int kAnimationDurationMs = 200;
// hide animation finishes.
const float kAnimationStartOrAfterHideOpacity = 0.2f;
+float GetKeyboardHeightRatio(){
+ if (keyboard::IsKeyboardUsabilityExperimentEnabled()) {
+ return 1.0f;
+ } else if (keyboard::GetAccessibilityKeyboardEnabled()) {
+ return 0.4f;
+ }
+ return 0.3f;
+}
gfx::Rect KeyboardBoundsFromWindowBounds(const gfx::Rect& window_bounds) {
- const float kKeyboardHeightRatio =
- keyboard::IsKeyboardUsabilityExperimentEnabled() ? 1.0f : 0.3f;
+ const float kKeyboardHeightRatio = GetKeyboardHeightRatio();
return gfx::Rect(
window_bounds.x(),
window_bounds.y() + window_bounds.height() * (1 - kKeyboardHeightRatio),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698