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

Side by Side Diff: chrome/browser/resources/keyboard/main.js

Issue 7033033: Add hideKeyboard API to chrome.experimental.input. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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, English virtual keyboard implementation. 6 * @fileoverview A simple, English 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 this.modeElements_[mode] = document.createElement('div'); 406 this.modeElements_[mode] = document.createElement('div');
407 this.modeElements_[mode].className = 'key'; 407 this.modeElements_[mode].className = 'key';
408 408
409 var hide = document.createElement('div'); 409 var hide = document.createElement('div');
410 hide.className = 'image-key hide'; 410 hide.className = 'image-key hide';
411 this.modeElements_[mode].appendChild(hide); 411 this.modeElements_[mode].appendChild(hide);
412 412
413 this.sizeElement(mode, height); 413 this.sizeElement(mode, height);
414 414
415 this.modeElements_[mode].onclick = function() { 415 this.modeElements_[mode].onclick = function() {
416 // TODO(bryeung): need a way to cancel the keyboard 416 chrome.experimental.inputUI.hideKeyboard();
417 }; 417 };
418 418
419 return this.modeElements_[mode]; 419 return this.modeElements_[mode];
420 } 420 }
421 }; 421 };
422 422
423 /** 423 /**
424 * A container for keys. 424 * A container for keys.
425 * @param {number} position The position of the row (0-3). 425 * @param {number} position The position of the row (0-3).
426 * @param {Array.<BaseKey>} keys The keys in the row. 426 * @param {Array.<BaseKey>} keys The keys in the row.
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 for (var i = 0; i < allRows.length; ++i) { 678 for (var i = 0; i < allRows.length; ++i) {
679 body.appendChild(allRows[i].makeDOM(getRowHeight())); 679 body.appendChild(allRows[i].makeDOM(getRowHeight()));
680 allRows[i].showMode(KEY_MODE); 680 allRows[i].showMode(KEY_MODE);
681 } 681 }
682 682
683 window.onresize(); 683 window.onresize();
684 } 684 }
685 685
686 // TODO(bryeung): would be nice to leave less gutter (without causing 686 // TODO(bryeung): would be nice to leave less gutter (without causing
687 // rendering issues with floated divs wrapping at some sizes). 687 // rendering issues with floated divs wrapping at some sizes).
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698