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

Unified Diff: chrome/browser/resources/keyboard/ime.js

Issue 7058046: Adjust virtual keyboard size base on input method candidates. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase on trunk Created 9 years, 6 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 | « chrome/browser/extensions/extension_input_api.cc ('k') | chrome/browser/resources/keyboard/main.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/keyboard/ime.js
diff --git a/chrome/browser/resources/keyboard/ime.js b/chrome/browser/resources/keyboard/ime.js
index 662e6f88d81a14b1310a43235e83c78b5d1eb282..2c94e051b1ed8d28264defb3ad5de41cc78a27c2 100644
--- a/chrome/browser/resources/keyboard/ime.js
+++ b/chrome/browser/resources/keyboard/ime.js
@@ -9,6 +9,7 @@
/**
* Const variables
*/
+const IME_KEYBOARD_HEIGHT = 300;
const IME_HEIGHT = 48;
const IME_VMARGIN = 12;
const IME_HMARGIN = 16;
@@ -123,6 +124,15 @@ ImeUi.prototype = {
}
this.appendChild(this.pageDown_);
+ this.update();
+ },
+
+ /**
+ * Returns true if Ime Ui is visible.
+ * @return {boolean}
+ */
+ get visible() {
+ return this.style.display != 'none';
},
/**
@@ -171,14 +181,21 @@ ImeUi.prototype = {
},
update : function() {
- // TODO(penghuang) Add API for show and hide ImeUI.
- // Currently, ImeUi is always visible.
- if (true || (this.table_ && this.table_.visible) || this.auxiliary_.text_) {
- this.style.display = 'block';
+ var visible =
+ (this.table_ && this.table_.visible) || this.auxiliary_.text_;
+
+ if (visible == this.visible) {
+ return;
+ }
+
+ if (visible) {
+ chrome.experimental.input.setKeyboardHeight(
+ IME_KEYBOARD_HEIGHT + IME_HEIGHT);
+ this.style.display = 'inline-block';
} else {
this.style.display = 'none';
+ chrome.experimental.input.setKeyboardHeight(IME_KEYBOARD_HEIGHT);
}
-
// TODO(penghuang) Adjust the width of all items in ImeUi to fill the width
// of keyboard.
},
« no previous file with comments | « chrome/browser/extensions/extension_input_api.cc ('k') | chrome/browser/resources/keyboard/main.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698