OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * The repeat delay in milliseconds before a key starts repeating. Use the | 6 * The repeat delay in milliseconds before a key starts repeating. Use the |
7 * same rate as Chromebook. | 7 * same rate as Chromebook. |
8 * (See chrome/browser/chromeos/language_preferences.cc) | 8 * (See chrome/browser/chromeos/language_preferences.cc) |
9 * @const | 9 * @const |
10 * @type {number} | 10 * @type {number} |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 addKeysetChangedObserver: function(callback) { | 361 addKeysetChangedObserver: function(callback) { |
362 this.addEventListener('stateChange', callback); | 362 this.addEventListener('stateChange', callback); |
363 }, | 363 }, |
364 | 364 |
365 /** | 365 /** |
366 * Called when the type of focused input box changes. If a keyboard layout | 366 * Called when the type of focused input box changes. If a keyboard layout |
367 * is defined for the current input type, that layout will be loaded. | 367 * is defined for the current input type, that layout will be loaded. |
368 * Otherwise, the keyboard layout for 'text' type will be loaded. | 368 * Otherwise, the keyboard layout for 'text' type will be loaded. |
369 */ | 369 */ |
370 inputTypeChanged: function() { | 370 inputTypeChanged: function() { |
371 // Disable layout switching at accessbility mode. | 371 // Disable layout switching at accessibility mode. |
372 if (this.config && this.config.a11ymode) | 372 if (this.config && this.config.a11ymode) |
373 return; | 373 return; |
374 | 374 |
375 // TODO(bshe): Toggle visibility of some keys in a keyboard layout | 375 // TODO(bshe): Toggle visibility of some keys in a keyboard layout |
376 // according to the input type. | 376 // according to the input type. |
377 var layout = this.inputTypeToLayoutMap[this.inputType]; | 377 var layout = this.inputTypeToLayoutMap[this.inputType]; |
378 if (!layout) | 378 if (!layout) |
379 layout = this.inputTypeToLayoutMap.text; | 379 layout = this.inputTypeToLayoutMap.text; |
380 this.layout = layout; | 380 this.layout = layout; |
381 }, | 381 }, |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
968 keyboardLoaded(); | 968 keyboardLoaded(); |
969 return true; | 969 return true; |
970 } | 970 } |
971 } | 971 } |
972 } | 972 } |
973 if (keysetsLoaded) | 973 if (keysetsLoaded) |
974 console.error('No default keyset found for ' + this.layout); | 974 console.error('No default keyset found for ' + this.layout); |
975 return false; | 975 return false; |
976 } | 976 } |
977 }); | 977 }); |
OLD | NEW |