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

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

Issue 7084033: Catch exception when register extension with inputUI. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Refine comment 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/keyboard/ime.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 * @type {Array.<Row>} 571 * @type {Array.<Row>}
572 */ 572 */
573 var allRows = []; // Populated during start() 573 var allRows = []; // Populated during start()
574 574
575 /** 575 /**
576 * Calculate the height of the row based on the size of the page. 576 * Calculate the height of the row based on the size of the page.
577 * @return {number} The height of each row, in pixels. 577 * @return {number} The height of each row, in pixels.
578 */ 578 */
579 function getRowHeight() { 579 function getRowHeight() {
580 var x = window.innerWidth; 580 var x = window.innerWidth;
581 var y = window.innerHeight - IME_HEIGHT - 2; 581 var y = window.innerHeight - (imeEnabled ? IME_HEIGHT - 2 : 0);
582 return (x > kKeyboardAspect * y) ? 582 return (x > kKeyboardAspect * y) ?
583 (height = Math.floor(y / 4)) : 583 (height = Math.floor(y / 4)) :
584 (height = Math.floor(x / (kKeyboardAspect * 4))); 584 (height = Math.floor(x / (kKeyboardAspect * 4)));
585 } 585 }
586 586
587 /** 587 /**
588 * Set the keyboard mode. 588 * Set the keyboard mode.
589 * @param {string} mode The new mode. 589 * @param {string} mode The new mode.
590 * @return {void} 590 * @return {void}
591 */ 591 */
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 682
683 for (var i = 0; i < allRows.length; ++i) { 683 for (var i = 0; i < allRows.length; ++i) {
684 body.appendChild(allRows[i].makeDOM(getRowHeight())); 684 body.appendChild(allRows[i].makeDOM(getRowHeight()));
685 allRows[i].showMode(KEY_MODE); 685 allRows[i].showMode(KEY_MODE);
686 } 686 }
687 687
688 window.onresize(); 688 window.onresize();
689 } 689 }
690 // TODO(bryeung): would be nice to leave less gutter (without causing 690 // TODO(bryeung): would be nice to leave less gutter (without causing
691 // rendering issues with floated divs wrapping at some sizes). 691 // rendering issues with floated divs wrapping at some sizes).
OLDNEW
« no previous file with comments | « chrome/browser/resources/keyboard/ime.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698