Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1314)

Unified Diff: chrome/browser/resources/options2/manage_profile_overlay.js

Issue 10579026: Fix edit profile link in NTP (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more nits Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e3aa1fab020eb55a571c116e7f1f170fce00dc25 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 (window.location.hash.length > 1)
+ ManageProfileOverlay.getInstance().prepareForManageDialog_();
$('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) {
+ prepareForManageDialog_: 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.prepareForManageDialog_();
OptionsPage.navigateToPage('manageProfile');
},

Powered by Google App Engine
This is Rietveld 408576698