Commit 095d8e65 authored by sail@chromium.org's avatar sail@chromium.org

Fix profile name resetting to GAIA name

If the user had a custom profile name then clicking on "Edit profile" would reset the name to their GAIA name.

The problem was that we were incorrectly detecting that the user had changed their profile picture to their GAIA picture. Clicking on the GAIA picture causes us to set the profile name to the GAIA name.

Fix was to only send profile picture changed events if the user actually changed their profile picture.

BUG=106382
TEST=Reproduced the bug. Applied my fix and verified that it no longer reproduced.


Review URL: http://codereview.chromium.org/8905001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114073 0039d316-1c4b-4281-b951-d872f2087c98
parent 275dbf43
......@@ -33,6 +33,9 @@ cr.define('options', function() {
// An object containing all known profile names.
profileNames_: {},
// The currently selected icon in the icon grid.
iconGridSelectedURL_: null,
/**
* Initialize the page.
*/
......@@ -91,6 +94,7 @@ cr.define('options', function() {
* @private
*/
setProfileInfo_: function(profileInfo) {
this.iconGridSelectedURL_ = profileInfo.iconURL;
this.profileInfo_ = profileInfo;
$('manage-profile-name').value = profileInfo.name;
$('manage-profile-icon-grid').selectedItem = profileInfo.iconURL;
......@@ -197,6 +201,9 @@ cr.define('options', function() {
*/
onIconGridSelectionChanged_: function() {
var iconURL = $('manage-profile-icon-grid').selectedItem;
if (!iconURL || iconURL == this.iconGridSelectedURL_)
return;
this.iconGridSelectedURL_ = iconURL;
chrome.send('profileIconSelectionChanged',
[this.profileInfo_.filePath, iconURL]);
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment