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

Side by Side Diff: chrome/browser/ui/views/profiles/new_avatar_button.cc

Issue 861053004: [Profiles] Send out less profile avatar related notifications (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/profiles/new_avatar_button.h" 5 #include "chrome/browser/ui/views/profiles/new_avatar_button.h"
6 6
7 #include "base/win/windows_version.h" 7 #include "base/win/windows_version.h"
8 #include "chrome/browser/browser_process.h" 8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/profiles/profile_manager.h" 9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/profiles/profiles_state.h" 10 #include "chrome/browser/profiles/profiles_state.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 UpdateAvatarButtonAndRelayoutParent(); 143 UpdateAvatarButtonAndRelayoutParent();
144 } 144 }
145 145
146 void NewAvatarButton::OnProfileNameChanged( 146 void NewAvatarButton::OnProfileNameChanged(
147 const base::FilePath& profile_path, 147 const base::FilePath& profile_path,
148 const base::string16& old_profile_name) { 148 const base::string16& old_profile_name) {
149 if (browser_->profile()->GetPath() == profile_path) 149 if (browser_->profile()->GetPath() == profile_path)
150 UpdateAvatarButtonAndRelayoutParent(); 150 UpdateAvatarButtonAndRelayoutParent();
151 } 151 }
152 152
153 void NewAvatarButton::OnProfileAvatarChanged(
154 const base::FilePath& profile_path) {
155 if (browser_->profile()->GetPath() == profile_path)
Mike Lerman 2015/01/27 16:39:16 Why remove this? Don't you want to do the same as
noms (inactive) 2015/01/27 17:02:20 NewAvatarButton only exists for the new profiles U
156 UpdateAvatarButtonAndRelayoutParent();
157 }
158
159 void NewAvatarButton::OnProfileSupervisedUserIdChanged( 153 void NewAvatarButton::OnProfileSupervisedUserIdChanged(
160 const base::FilePath& profile_path) { 154 const base::FilePath& profile_path) {
161 if (browser_->profile()->GetPath() == profile_path) 155 if (browser_->profile()->GetPath() == profile_path)
162 UpdateAvatarButtonAndRelayoutParent(); 156 UpdateAvatarButtonAndRelayoutParent();
163 } 157 }
164 158
165 void NewAvatarButton::OnErrorChanged() { 159 void NewAvatarButton::OnErrorChanged() {
166 // If there is an error, show an warning icon. 160 // If there is an error, show an warning icon.
167 const SigninErrorController* error = 161 const SigninErrorController* error =
168 profiles::GetSigninErrorController(browser_->profile()); 162 profiles::GetSigninErrorController(browser_->profile());
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 const int kDefaultImageTextSpacing = 5; 202 const int kDefaultImageTextSpacing = 5;
209 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing); 203 SetImageLabelSpacing(use_generic_button ? 0 : kDefaultImageTextSpacing);
210 204
211 InvalidateLayout(); 205 InvalidateLayout();
212 206
213 // Because the width of the button might have changed, the parent browser 207 // Because the width of the button might have changed, the parent browser
214 // frame needs to recalculate the button bounds and redraw it. 208 // frame needs to recalculate the button bounds and redraw it.
215 if (parent()) 209 if (parent())
216 parent()->Layout(); 210 parent()->Layout();
217 } 211 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698