Chromium Code Reviews| Index: chrome/browser/resources/options2/manage_profile_overlay.js |
| diff --git a/chrome/browser/resources/options2/manage_profile_overlay.js b/chrome/browser/resources/options2/manage_profile_overlay.js |
| index a1c3713e9702cf0affa547dd193450b53335b606..4c2f5a7e1ab3f2212bc6409d41e1b7fe46b51ab1 100644 |
| --- a/chrome/browser/resources/options2/manage_profile_overlay.js |
| +++ b/chrome/browser/resources/options2/manage_profile_overlay.js |
| @@ -66,15 +66,10 @@ cr.define('options', function() { |
| didShowPage: function() { |
| chrome.send('requestDefaultProfileIcons'); |
| - // Use the hash to specify the profile index. |
| - var hash = location.hash; |
| - if (hash) { |
| - $('manage-profile-overlay-manage').hidden = false; |
| - $('manage-profile-overlay-delete').hidden = true; |
| - ManageProfileOverlay.getInstance().hideErrorBubble_(); |
| - |
| - chrome.send('requestProfileInfo', [parseInt(hash.slice(1), 10)]); |
| - } |
| + // Use the hash to specify the profile index. Note: the actual index |
| + // is ignored. Only the current profile may be edited. |
| + if (location.hash && location.hash.length > 1) |
|
Dan Beam
2012/06/20 02:25:19
why do you need to check for the truthiness of .ha
Evan Stade
2012/06/20 22:10:06
Done.
|
| + ManageProfileOverlay.getInstance().populateManageDialog_(); |
| $('manage-profile-name').focus(); |
| }, |
| @@ -116,8 +111,6 @@ cr.define('options', function() { |
| receiveDefaultProfileIcons_: function(iconURLs) { |
| $('manage-profile-icon-grid').dataModel = new ArrayDataModel(iconURLs); |
| - // Changing the dataModel resets the selectedItem. Re-select it, if there |
| - // is one. |
| if (this.profileInfo_) |
| $('manage-profile-icon-grid').selectedItem = this.profileInfo_.iconURL; |
| @@ -206,16 +199,24 @@ cr.define('options', function() { |
| }, |
| /** |
| - * Display the "Manage Profile" dialog. |
| - * @param {Object} profileInfo The profile object of the profile to manage. |
| + * Updates the contents of the "Manage Profile" section of the dialog, |
| + * and shows that section. |
| * @private |
| */ |
| - showManageDialog_: function(profileInfo) { |
| + populateManageDialog_: function() { |
| + var profileInfo = BrowserOptions.getCurrentProfile(); |
| ManageProfileOverlay.setProfileInfo(profileInfo); |
| $('manage-profile-overlay-manage').hidden = false; |
| $('manage-profile-overlay-delete').hidden = true; |
| - ManageProfileOverlay.getInstance().hideErrorBubble_(); |
| + this.hideErrorBubble_(); |
| + }, |
| + /** |
| + * Display the "Manage Profile" dialog. |
| + * @private |
| + */ |
| + showManageDialog_: function() { |
| + this.populateManageDialog_(); |
| OptionsPage.navigateToPage('manageProfile'); |
| }, |