OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // TODO(kochi): Generalize the notification as a component and put it | 5 // TODO(kochi): Generalize the notification as a component and put it |
6 // in js/cr/ui/notification.js . | 6 // in js/cr/ui/notification.js . |
7 | 7 |
8 cr.define('options', function() { | 8 cr.define('options', function() { |
9 /** @const */ var Page = cr.ui.pageManager.Page; | 9 /** @const */ var Page = cr.ui.pageManager.Page; |
10 /** @const */ var PageManager = cr.ui.pageManager.PageManager; | 10 /** @const */ var PageManager = cr.ui.pageManager.PageManager; |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1342 // necessary as a language code for Translate server. | 1342 // necessary as a language code for Translate server. |
1343 return languageCode; | 1343 return languageCode; |
1344 } | 1344 } |
1345 | 1345 |
1346 return main; | 1346 return main; |
1347 }, | 1347 }, |
1348 }; | 1348 }; |
1349 | 1349 |
1350 /** | 1350 /** |
1351 * Shows the node at |index| in |nodes|, hides all others. | 1351 * Shows the node at |index| in |nodes|, hides all others. |
1352 * @param {Array.<HTMLElement>} nodes The nodes to be shown or hidden. | 1352 * @param {Array<HTMLElement>} nodes The nodes to be shown or hidden. |
1353 * @param {number} index The index of |nodes| to show. | 1353 * @param {number} index The index of |nodes| to show. |
1354 */ | 1354 */ |
1355 function showMutuallyExclusiveNodes(nodes, index) { | 1355 function showMutuallyExclusiveNodes(nodes, index) { |
1356 assert(index >= 0 && index < nodes.length); | 1356 assert(index >= 0 && index < nodes.length); |
1357 for (var i = 0; i < nodes.length; ++i) { | 1357 for (var i = 0; i < nodes.length; ++i) { |
1358 assert(nodes[i] instanceof HTMLElement); // TODO(dbeam): Ignore null? | 1358 assert(nodes[i] instanceof HTMLElement); // TODO(dbeam): Ignore null? |
1359 nodes[i].hidden = i != index; | 1359 nodes[i].hidden = i != index; |
1360 } | 1360 } |
1361 } | 1361 } |
1362 | 1362 |
(...skipping 11 matching lines...) Expand all Loading... |
1374 | 1374 |
1375 LanguageOptions.onDictionaryDownloadFailure = function(languageCode) { | 1375 LanguageOptions.onDictionaryDownloadFailure = function(languageCode) { |
1376 LanguageOptions.getInstance().onDictionaryDownloadFailure_(languageCode); | 1376 LanguageOptions.getInstance().onDictionaryDownloadFailure_(languageCode); |
1377 }; | 1377 }; |
1378 | 1378 |
1379 // Export | 1379 // Export |
1380 return { | 1380 return { |
1381 LanguageOptions: LanguageOptions | 1381 LanguageOptions: LanguageOptions |
1382 }; | 1382 }; |
1383 }); | 1383 }); |
OLD | NEW |