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 cr.define('hotword', function() { | 5 cr.define('hotword', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Class used to manage the state of the NaCl recognizer plugin. Handles all | 9 * Class used to manage the state of the NaCl recognizer plugin. Handles all |
10 * control of the NaCl plugin, including creation, start, stop, trigger, and | 10 * control of the NaCl plugin, including creation, start, stop, trigger, and |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 } | 231 } |
232 if (xhr.readyState != xhr.DONE || xhr.status != 200) { | 232 if (xhr.readyState != xhr.DONE || xhr.status != 200) { |
233 return false; | 233 return false; |
234 } | 234 } |
235 return true; | 235 return true; |
236 }; | 236 }; |
237 | 237 |
238 /** | 238 /** |
239 * Creates and returns a list of possible languages to check for hotword | 239 * Creates and returns a list of possible languages to check for hotword |
240 * support. | 240 * support. |
241 * @return {!Array.<string>} Array of languages. | 241 * @return {!Array<string>} Array of languages. |
242 * @private | 242 * @private |
243 */ | 243 */ |
244 NaClManager.prototype.getPossibleLanguages_ = function() { | 244 NaClManager.prototype.getPossibleLanguages_ = function() { |
245 // Create array used to search first for language-country, if not found then | 245 // Create array used to search first for language-country, if not found then |
246 // search for language, if not found then no language (empty string). | 246 // search for language, if not found then no language (empty string). |
247 // For example, search for 'en-us', then 'en', then ''. | 247 // For example, search for 'en-us', then 'en', then ''. |
248 var langs = new Array(); | 248 var langs = new Array(); |
249 if (hotword.constants.UI_LANGUAGE) { | 249 if (hotword.constants.UI_LANGUAGE) { |
250 // Chrome webstore doesn't support uppercase path: crbug.com/353407 | 250 // Chrome webstore doesn't support uppercase path: crbug.com/353407 |
251 var language = hotword.constants.UI_LANGUAGE.toLowerCase(); | 251 var language = hotword.constants.UI_LANGUAGE.toLowerCase(); |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 break; | 554 break; |
555 } | 555 } |
556 } | 556 } |
557 }; | 557 }; |
558 | 558 |
559 return { | 559 return { |
560 NaClManager: NaClManager | 560 NaClManager: NaClManager |
561 }; | 561 }; |
562 | 562 |
563 }); | 563 }); |
OLD | NEW |