Chromium Code Reviews| 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. |
| }, |