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

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

Issue 8711002: Add GAIA picture to Settings profile overlay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 9 years, 1 month 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/options/manage_profile_overlay.js
diff --git a/chrome/browser/resources/options/manage_profile_overlay.js b/chrome/browser/resources/options/manage_profile_overlay.js
index 5a931a9e6007d0df769557b5b8bbd9b0f46dc23d..d36be4bb26e6b0b13abef89d20c9f28601cf0a05 100644
--- a/chrome/browser/resources/options/manage_profile_overlay.js
+++ b/chrome/browser/resources/options/manage_profile_overlay.js
@@ -43,6 +43,9 @@ cr.define('options', function() {
var self = this;
var iconGrid = $('manage-profile-icon-grid');
options.ProfilesIconGrid.decorate(iconGrid);
+ iconGrid.addEventListener('change', function(e) {
+ self.onIconGridSelectionChanged_();
+ });
$('manage-profile-name').oninput = this.onNameChanged_.bind(this);
$('manage-profile-cancel').onclick =
@@ -94,6 +97,16 @@ cr.define('options', function() {
},
/**
+ * Sets the name of the currently edited profile.
+ * @private
+ */
+ setProfileName_: function(name) {
+ if (this.profileInfo_)
+ this.profileInfo_.name = name;
+ $('manage-profile-name').value = name;
+ },
+
+ /**
* Set an array of default icon URLs. These will be added to the grid that
* the user will use to choose their profile icon.
* @param {Array.<string>} iconURLs An array of icon URLs.
@@ -179,6 +192,16 @@ cr.define('options', function() {
},
/**
+ * Called when the selected icon in the icon grid changes.
+ * @private
+ */
+ onIconGridSelectionChanged_: function() {
+ var iconURL = $('manage-profile-icon-grid').selectedItem;
+ chrome.send('profileIconSelectionChanged',
+ [this.profileInfo_.filePath, iconURL]);
+ },
+
+ /**
* Display the "Manage Profile" dialog.
* @param {Object} profileInfo The profile object of the profile to manage.
* @private
@@ -217,6 +240,7 @@ cr.define('options', function() {
'receiveDefaultProfileIcons',
'receiveProfileNames',
'setProfileInfo',
+ 'setProfileName',
'showManageDialog',
'showDeleteDialog',
].forEach(function(name) {
« no previous file with comments | « chrome/browser/profiles/profile_info_util_unittest.cc ('k') | chrome/browser/ui/webui/options/manage_profile_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698