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

Unified Diff: ui/keyboard/resources/main.js

Issue 240443006: Remove native VK window height logic and wait for resizeTo to setup VK window height (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 6 years, 8 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
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);
}
« ui/keyboard/keyboard_controller_unittest.cc ('K') | « ui/keyboard/resources/constants.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698