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 Grid = cr.ui.Grid; | 7 /** @const */ var Grid = cr.ui.Grid; |
8 /** @const */ var GridItem = cr.ui.GridItem; | 8 /** @const */ var GridItem = cr.ui.GridItem; |
9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; | 9 /** @const */ var GridSelectionController = cr.ui.GridSelectionController; |
10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; | 10 /** @const */ var ListSingleSelectionModel = cr.ui.ListSingleSelectionModel; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 118 |
119 /** @override */ | 119 /** @override */ |
120 createSelectionController: function(sm) { | 120 createSelectionController: function(sm) { |
121 return new UserImagesGridSelectionController(sm, this); | 121 return new UserImagesGridSelectionController(sm, this); |
122 }, | 122 }, |
123 | 123 |
124 /** @override */ | 124 /** @override */ |
125 decorate: function() { | 125 decorate: function() { |
126 Grid.prototype.decorate.call(this); | 126 Grid.prototype.decorate.call(this); |
127 this.dataModel = new ArrayDataModel([]); | 127 this.dataModel = new ArrayDataModel([]); |
128 this.itemConstructor = UserImagesGridItem; | 128 this.itemConstructor = |
| 129 /** @type {function(new:cr.ui.ListItem, Object)} */( |
| 130 UserImagesGridItem); |
129 this.selectionModel = new ListSingleSelectionModel(); | 131 this.selectionModel = new ListSingleSelectionModel(); |
130 this.inProgramSelection_ = false; | 132 this.inProgramSelection_ = false; |
131 this.addEventListener('dblclick', this.handleDblClick_.bind(this)); | 133 this.addEventListener('dblclick', this.handleDblClick_.bind(this)); |
132 this.addEventListener('change', this.handleChange_.bind(this)); | 134 this.addEventListener('change', this.handleChange_.bind(this)); |
133 this.setAttribute('role', 'listbox'); | 135 this.setAttribute('role', 'listbox'); |
134 this.autoExpands = true; | 136 this.autoExpands = true; |
135 }, | 137 }, |
136 | 138 |
137 /** | 139 /** |
138 * Handles double click on the image grid. | 140 * Handles double click on the image grid. |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 UserImagesGrid.ButtonImages = { | 644 UserImagesGrid.ButtonImages = { |
643 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', | 645 TAKE_PHOTO: 'chrome://theme/IDR_BUTTON_USER_IMAGE_TAKE_PHOTO', |
644 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', | 646 CHOOSE_FILE: 'chrome://theme/IDR_BUTTON_USER_IMAGE_CHOOSE_FILE', |
645 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING' | 647 PROFILE_PICTURE: 'chrome://theme/IDR_PROFILE_PICTURE_LOADING' |
646 }; | 648 }; |
647 | 649 |
648 return { | 650 return { |
649 UserImagesGrid: UserImagesGrid | 651 UserImagesGrid: UserImagesGrid |
650 }; | 652 }; |
651 }); | 653 }); |
OLD | NEW |