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

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: Update Created 9 years, 7 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: chrome/browser/resources/keyboard/ime.js
diff --git a/chrome/browser/resources/keyboard/ime.js b/chrome/browser/resources/keyboard/ime.js
index 80c89937b8970e96da7d25e1ec3f6dd830b9a0ec..33bbc5c37c6b811075268c2b900418aae3bf1de6 100644
--- a/chrome/browser/resources/keyboard/ime.js
+++ b/chrome/browser/resources/keyboard/ime.js
@@ -123,6 +123,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 +180,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';
- } else {
- this.style.display = 'none';
+ var should_visible =
bryeung 2011/06/03 19:14:52 maybe just visible or visible_now?
Peng 2011/06/03 22:22:10 Done.
+ (this.table_ && this.table_.visible) || this.auxiliary_.text_;
+
+ if (should_visible == this.visible) {
+ return;
}
+ if (should_visible) {
+ chrome.experimental.input.setKeyboardHeight(300 + IME_HEIGHT);
+ this.style.display = 'inline-block';
+ }
+ else {
bryeung 2011/06/03 19:14:52 nit: move to line above
Peng 2011/06/03 22:22:10 Done.
+ this.style.display = 'none';
+ chrome.experimental.input.setKeyboardHeight(300);
+ }
// TODO(penghuang) Adjust the width of all items in ImeUi to fill the width
// of keyboard.
},

Powered by Google App Engine
This is Rietveld 408576698