| 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | 6 /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; |
| 7 /** @const */ var DeletableItem = options.DeletableItem; | 7 /** @const */ var DeletableItem = options.DeletableItem; |
| 8 /** @const */ var DeletableItemList = options.DeletableItemList; | 8 /** @const */ var DeletableItemList = options.DeletableItemList; |
| 9 /** @const */ var List = cr.ui.List; | 9 /** @const */ var List = cr.ui.List; |
| 10 /** @const */ var ListItem = cr.ui.ListItem; | 10 /** @const */ var ListItem = cr.ui.ListItem; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 }, | 168 }, |
| 169 | 169 |
| 170 /* | 170 /* |
| 171 * Gets the language codes of the currently listed languages. | 171 * Gets the language codes of the currently listed languages. |
| 172 */ | 172 */ |
| 173 getLanguageCodes: function() { | 173 getLanguageCodes: function() { |
| 174 return this.dataModel.slice(); | 174 return this.dataModel.slice(); |
| 175 }, | 175 }, |
| 176 | 176 |
| 177 /* | 177 /* |
| 178 * Clears the selection |
| 179 */ |
| 180 clearSelection: function() { |
| 181 this.selectionModel.unselectAll(); |
| 182 }, |
| 183 |
| 184 /* |
| 178 * Gets the language code of the selected language. | 185 * Gets the language code of the selected language. |
| 179 */ | 186 */ |
| 180 getSelectedLanguageCode: function() { | 187 getSelectedLanguageCode: function() { |
| 181 return this.selectedItem; | 188 return this.selectedItem; |
| 182 }, | 189 }, |
| 183 | 190 |
| 184 /* | 191 /* |
| 185 * Selects the language by the given language code. | 192 * Selects the language by the given language code. |
| 186 * @returns {boolean} True if the operation is successful. | 193 * @returns {boolean} True if the operation is successful. |
| 187 */ | 194 */ |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 } | 466 } |
| 460 return filteredLanguageCodes; | 467 return filteredLanguageCodes; |
| 461 }, | 468 }, |
| 462 }; | 469 }; |
| 463 | 470 |
| 464 return { | 471 return { |
| 465 LanguageList: LanguageList, | 472 LanguageList: LanguageList, |
| 466 LanguageListItem: LanguageListItem | 473 LanguageListItem: LanguageListItem |
| 467 }; | 474 }; |
| 468 }); | 475 }); |
| OLD | NEW |