Index: ui/keyboard/resources/main.js |
diff --git a/ui/keyboard/resources/main.js b/ui/keyboard/resources/main.js |
index 8eb8d5bbb10942a199dbaa7614e18c48d9b2a025..c837aed2ad95aa7d9054c7c6fa15003843adc491 100644 |
--- a/ui/keyboard/resources/main.js |
+++ b/ui/keyboard/resources/main.js |
@@ -205,9 +205,14 @@ |
* @return {Array.<String, number>} The bounds of the keyboard container. |
*/ |
function getKeyboardBounds_() { |
+ var keyboard = $('keyboard'); |
+ var ratio = DEFAULT_KEYBOARD_ASPECT_RATIO; |
+ if (keyboard.config && keyboard.config.a11ymode) { |
+ ratio = DEFAULT_A11Y_KEYBOARD_ASPECT_RATIO; |
+ } |
return { |
- "width": window.innerWidth, |
- "height": window.innerHeight, |
+ "width": screen.width, |
+ "height": screen.height * ratio |
}; |
} |
@@ -566,8 +571,7 @@ |
*/ |
function resizeKeyboardContainer(opt_params) { |
var params = opt_params ? opt_params : new AlignmentOptions(); |
- var bounds = getKeyboardBounds(); |
- if (Math.abs(bounds.height - params.height) > RESIZE_THRESHOLD) { |
+ if (Math.abs(window.innerHeight - params.height) > RESIZE_THRESHOLD) { |
// Cannot resize more than 50% of screen height due to crbug.com/338829. |
window.resizeTo(params.width, params.height); |
} |