| OLD | NEW |
| 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 // require: array_data_model.js | 5 // require: array_data_model.js |
| 6 // require: list_selection_model.js | 6 // require: list_selection_model.js |
| 7 // require: list_selection_controller.js | 7 // require: list_selection_controller.js |
| 8 // require: list_item.js | 8 // require: list_item.js |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 681 }, | 681 }, |
| 682 | 682 |
| 683 /** | 683 /** |
| 684 * Creates a new list item. | 684 * Creates a new list item. |
| 685 * @param {*} value The value to use for the item. | 685 * @param {*} value The value to use for the item. |
| 686 * @return {!ListItem} The newly created list item. | 686 * @return {!ListItem} The newly created list item. |
| 687 */ | 687 */ |
| 688 createItem: function(value) { | 688 createItem: function(value) { |
| 689 var item = new this.itemConstructor_(value); | 689 var item = new this.itemConstructor_(value); |
| 690 item.label = value; | 690 item.label = value; |
| 691 item.decorate(); | 691 if (typeof item.decorate == 'function') |
| 692 item.decorate(); |
| 692 return item; | 693 return item; |
| 693 }, | 694 }, |
| 694 | 695 |
| 695 /** | 696 /** |
| 696 * Creates the selection controller to use internally. | 697 * Creates the selection controller to use internally. |
| 697 * @param {cr.ui.ListSelectionModel} sm The underlying selection model. | 698 * @param {cr.ui.ListSelectionModel} sm The underlying selection model. |
| 698 * @return {!cr.ui.ListSelectionController} The newly created selection | 699 * @return {!cr.ui.ListSelectionController} The newly created selection |
| 699 * controller. | 700 * controller. |
| 700 */ | 701 */ |
| 701 createSelectionController: function(sm) { | 702 createSelectionController: function(sm) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 931 * because list items can contain controls that can be focused, and for some | 932 * because list items can contain controls that can be focused, and for some |
| 932 * purposes (e.g., styling), the list can still be conceptually focused at | 933 * purposes (e.g., styling), the list can still be conceptually focused at |
| 933 * that point even though it doesn't actually have the page focus. | 934 * that point even though it doesn't actually have the page focus. |
| 934 */ | 935 */ |
| 935 cr.defineProperty(List, 'hasElementFocus', cr.PropertyKind.BOOL_ATTR); | 936 cr.defineProperty(List, 'hasElementFocus', cr.PropertyKind.BOOL_ATTR); |
| 936 | 937 |
| 937 return { | 938 return { |
| 938 List: List | 939 List: List |
| 939 } | 940 } |
| 940 }); | 941 }); |
| OLD | NEW |