Commit 04a94043 authored by treib@chromium.org's avatar treib@chromium.org

New avatar button: Update when the supervised user ID changes.

BUG=372381

Review URL: https://codereview.chromium.org/334283002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278732 0039d316-1c4b-4281-b951-d872f2087c98
parent 5b461422
......@@ -554,6 +554,11 @@ void ProfileInfoCache::SetSupervisedUserIdOfProfileAtIndex(
info->SetString(kSupervisedUserId, id);
// This takes ownership of |info|.
SetInfoForProfileAtIndex(index, info.release());
base::FilePath profile_path = GetPathOfProfileAtIndex(index);
FOR_EACH_OBSERVER(ProfileInfoCacheObserver,
observer_list_,
OnProfileSupervisedUserIdChanged(profile_path));
}
void ProfileInfoCache::SetLocalAuthCredentialsOfProfileAtIndex(
......
......@@ -27,6 +27,8 @@ class ProfileInfoCacheObserver {
virtual void OnProfileAvatarChanged(const base::FilePath& profile_path) {}
virtual void OnProfileSigninRequiredChanged(
const base::FilePath& profile_path) {}
virtual void OnProfileSupervisedUserIdChanged(
const base::FilePath& profile_path) {}
protected:
ProfileInfoCacheObserver() {}
......
......@@ -91,6 +91,11 @@ class ProfileInfoUpdateObserver : public ProfileInfoCacheObserver,
[avatarController_ updateAvatarButtonAndLayoutParent:YES];
}
virtual void OnProfileSupervisedUserIdChanged(
const base::FilePath& profile_path) OVERRIDE {
[avatarController_ updateAvatarButtonAndLayoutParent:YES];
}
// SigninErrorController::Observer:
virtual void OnErrorChanged() OVERRIDE {
SigninErrorController* errorController =
......
......@@ -151,6 +151,11 @@ void NewAvatarButton::OnProfileNameChanged(
UpdateAvatarButtonAndRelayoutParent();
}
void NewAvatarButton::OnProfileSupervisedUserIdChanged(
const base::FilePath& profile_path) {
UpdateAvatarButtonAndRelayoutParent();
}
void NewAvatarButton::OnErrorChanged() {
gfx::ImageSkia icon;
......
......@@ -42,6 +42,8 @@ class NewAvatarButton : public views::MenuButton,
virtual void OnProfileNameChanged(
const base::FilePath& profile_path,
const base::string16& old_profile_name) OVERRIDE;
virtual void OnProfileSupervisedUserIdChanged(
const base::FilePath& profile_path) OVERRIDE;
// SigninErrorController::Observer:
virtual void OnErrorChanged() OVERRIDE;
......
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