| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 * Display the "Delete Profile" dialog. | 198 * Display the "Delete Profile" dialog. |
| 199 * @param {Object} profileInfo The profile object of the profile to delete. | 199 * @param {Object} profileInfo The profile object of the profile to delete. |
| 200 * @private | 200 * @private |
| 201 */ | 201 */ |
| 202 showDeleteDialog_: function(profileInfo) { | 202 showDeleteDialog_: function(profileInfo) { |
| 203 ManageProfileOverlay.setProfileInfo(profileInfo); | 203 ManageProfileOverlay.setProfileInfo(profileInfo); |
| 204 $('manage-profile-overlay-manage').hidden = true; | 204 $('manage-profile-overlay-manage').hidden = true; |
| 205 $('manage-profile-overlay-delete').hidden = false; | 205 $('manage-profile-overlay-delete').hidden = false; |
| 206 $('delete-profile-message').textContent = | 206 $('delete-profile-message').textContent = |
| 207 localStrings.getStringF('deleteProfileMessage', profileInfo.name); | 207 localStrings.getStringF('deleteProfileMessage', profileInfo.name); |
| 208 $('delete-profile-avatar').src = profileInfo.iconURL; |
| 208 | 209 |
| 209 // Intentionally don't show the URL in the location bar as we don't want | 210 // Intentionally don't show the URL in the location bar as we don't want |
| 210 // people trying to navigate here by hand. | 211 // people trying to navigate here by hand. |
| 211 OptionsPage.showPageByName('manageProfile', false); | 212 OptionsPage.showPageByName('manageProfile', false); |
| 212 }, | 213 }, |
| 213 }; | 214 }; |
| 214 | 215 |
| 215 // Forward public APIs to private implementations. | 216 // Forward public APIs to private implementations. |
| 216 [ | 217 [ |
| 217 'receiveDefaultProfileIcons', | 218 'receiveDefaultProfileIcons', |
| 218 'receiveProfileNames', | 219 'receiveProfileNames', |
| 219 'setProfileInfo', | 220 'setProfileInfo', |
| 220 'showManageDialog', | 221 'showManageDialog', |
| 221 'showDeleteDialog', | 222 'showDeleteDialog', |
| 222 ].forEach(function(name) { | 223 ].forEach(function(name) { |
| 223 ManageProfileOverlay[name] = function(value) { | 224 ManageProfileOverlay[name] = function(value) { |
| 224 ManageProfileOverlay.getInstance()[name + '_'](value); | 225 ManageProfileOverlay.getInstance()[name + '_'](value); |
| 225 }; | 226 }; |
| 226 }); | 227 }); |
| 227 | 228 |
| 228 // Export | 229 // Export |
| 229 return { | 230 return { |
| 230 ManageProfileOverlay: ManageProfileOverlay | 231 ManageProfileOverlay: ManageProfileOverlay |
| 231 }; | 232 }; |
| 232 }); | 233 }); |
| OLD | NEW |