OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview A simple virtual keyboard implementation. | 6 * @fileoverview A simple virtual keyboard implementation. |
7 */ | 7 */ |
8 | 8 |
9 var KEY_MODE = 'key'; | 9 var KEY_MODE = 'key'; |
10 var SHIFT_MODE = 'shift'; | 10 var SHIFT_MODE = 'shift'; |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 | 625 |
626 HideKeyboardKey.prototype = { | 626 HideKeyboardKey.prototype = { |
627 __proto__: BaseKey.prototype, | 627 __proto__: BaseKey.prototype, |
628 | 628 |
629 /** @override */ | 629 /** @override */ |
630 makeDOM: function(mode) { | 630 makeDOM: function(mode) { |
631 this.modeElements_[mode] = document.createElement('div'); | 631 this.modeElements_[mode] = document.createElement('div'); |
632 this.modeElements_[mode].className = 'key hide'; | 632 this.modeElements_[mode].className = 'key hide'; |
633 addContent(this.modeElements_[mode]); | 633 addContent(this.modeElements_[mode]); |
634 | 634 |
635 setupKeyEventHandlers(this, this.modeElements_[mode], | 635 setupKeyEventHandlers( |
636 { 'down': function() { console.log('Hide the keyboard!'); } }); | 636 this, |
| 637 this.modeElements_[mode], |
| 638 {'down': function() { setKeyboardVisibility(false); }}); |
637 | 639 |
638 return this.modeElements_[mode]; | 640 return this.modeElements_[mode]; |
639 } | 641 } |
640 }; | 642 }; |
641 | 643 |
642 /** | 644 /** |
643 * A container for keys. | 645 * A container for keys. |
644 * @param {number} position The position of the row (0-3). | 646 * @param {number} position The position of the row (0-3). |
645 * @param {Array.<BaseKey>} keys The keys in the row. | 647 * @param {Array.<BaseKey>} keys The keys in the row. |
646 * @constructor | 648 * @constructor |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
698 }, | 700 }, |
699 | 701 |
700 /** | 702 /** |
701 * Returns the size of keys this row contains. | 703 * Returns the size of keys this row contains. |
702 * @return {number} The size of keys. | 704 * @return {number} The size of keys. |
703 */ | 705 */ |
704 get length() { | 706 get length() { |
705 return this.keys_.length; | 707 return this.keys_.length; |
706 } | 708 } |
707 }; | 709 }; |
OLD | NEW |