| 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
| 7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
| 8 | 8 |
| 9 const localStrings = new LocalStrings(); | 9 const localStrings = new LocalStrings(); |
| 10 | 10 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 /** | 96 /** |
| 97 * Set an array of default icon URLs. These will be added to the grid that | 97 * Set an array of default icon URLs. These will be added to the grid that |
| 98 * the user will use to choose their profile icon. | 98 * the user will use to choose their profile icon. |
| 99 * @param {Array.<string>} iconURLs An array of icon URLs. | 99 * @param {Array.<string>} iconURLs An array of icon URLs. |
| 100 * @private | 100 * @private |
| 101 */ | 101 */ |
| 102 receiveDefaultProfileIcons_: function(iconURLs) { | 102 receiveDefaultProfileIcons_: function(iconURLs) { |
| 103 $('manage-profile-icon-grid').dataModel = new ArrayDataModel(iconURLs); | 103 $('manage-profile-icon-grid').dataModel = new ArrayDataModel(iconURLs); |
| 104 | 104 |
| 105 // Changing the dataModel resets the selectedItem. Re-select it, if there |
| 106 // is one. |
| 107 if (this.profileInfo_) |
| 108 $('manage-profile-icon-grid').selectedItem = this.profileInfo_.iconURL; |
| 109 |
| 105 var grid = $('manage-profile-icon-grid'); | 110 var grid = $('manage-profile-icon-grid'); |
| 106 // Recalculate the measured item size. | 111 // Recalculate the measured item size. |
| 107 grid.measured_ = null; | 112 grid.measured_ = null; |
| 108 grid.columns = 0; | 113 grid.columns = 0; |
| 109 grid.redraw(); | 114 grid.redraw(); |
| 110 }, | 115 }, |
| 111 | 116 |
| 112 /** | 117 /** |
| 113 * Set a dictionary of all profile names. These are used to prevent the | 118 * Set a dictionary of all profile names. These are used to prevent the |
| 114 * user from naming two profiles the same. | 119 * user from naming two profiles the same. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 ManageProfileOverlay[name] = function(value) { | 223 ManageProfileOverlay[name] = function(value) { |
| 219 ManageProfileOverlay.getInstance()[name + '_'](value); | 224 ManageProfileOverlay.getInstance()[name + '_'](value); |
| 220 }; | 225 }; |
| 221 }); | 226 }); |
| 222 | 227 |
| 223 // Export | 228 // Export |
| 224 return { | 229 return { |
| 225 ManageProfileOverlay: ManageProfileOverlay | 230 ManageProfileOverlay: ManageProfileOverlay |
| 226 }; | 231 }; |
| 227 }); | 232 }); |
| OLD | NEW |