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..92204dbda583a3b5210f85b8fa19f22520c681e8 100644 |
--- a/chrome/browser/resources/options2/manage_profile_overlay.js |
+++ b/chrome/browser/resources/options2/manage_profile_overlay.js |
@@ -64,17 +64,13 @@ cr.define('options', function() { |
/** @inheritDoc */ |
didShowPage: function() { |
- chrome.send('requestDefaultProfileIcons'); |
+ if (!$('manage-profile-icon-grid').dataModel) |
+ 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) |
Dan Beam
2012/06/19 23:44:25
window.location.hash.length > 1, IMO, unless you w
Evan Stade
2012/06/20 02:04:31
done
Dan Beam
2012/06/20 02:22:07
we tend to prefix with window (even when it's shad
Evan Stade
2012/06/20 02:24:55
Done.
|
+ ManageProfileOverlay.getInstance().populateManageDialog_(); |
$('manage-profile-name').focus(); |
}, |
@@ -116,8 +112,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 +200,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; |
Dan Beam
2012/06/19 23:44:25
it would seem that these belong back in the "showi
Evan Stade
2012/06/20 02:04:31
well, it has to be here to work correctly. Would y
Dan Beam
2012/06/20 02:22:07
sure, change to prepareManageDialog_()
Evan Stade
2012/06/20 02:24:55
Done.
|
- ManageProfileOverlay.getInstance().hideErrorBubble_(); |
+ this.hideErrorBubble_(); |
+ }, |
+ /** |
+ * Display the "Manage Profile" dialog. |
+ * @private |
+ */ |
+ showManageDialog_: function() { |
+ this.populateManageDialog_(); |
OptionsPage.navigateToPage('manageProfile'); |
}, |