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

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

Issue 10689084: Merge 143541 - Fix edit profile link in NTP (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: 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
===================================================================
--- chrome/browser/resources/options2/manage_profile_overlay.js (revision 145236)
+++ chrome/browser/resources/options2/manage_profile_overlay.js (working copy)
@@ -66,16 +66,11 @@
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_();
+ // 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_();
- chrome.send('requestProfileInfo', [parseInt(hash.slice(1), 10)]);
- }
-
$('manage-profile-name').focus();
},
@@ -116,8 +111,6 @@
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 @@
},
/**
- * 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');
},
« no previous file with comments | « chrome/browser/resources/options2/browser_options.js ('k') | chrome/browser/ui/webui/options2/manage_profile_handler2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698