Chromium Code Reviews| Index: chrome/browser/ui/views/frame/avatar_button_manager.cc |
| diff --git a/chrome/browser/ui/views/frame/avatar_button_manager.cc b/chrome/browser/ui/views/frame/avatar_button_manager.cc |
| index c5ebffc22e9ee50fe67c1ddcef8a2fad7b010391..cd82ebda2156e5445f15472c9d7315029fae8ef4 100644 |
| --- a/chrome/browser/ui/views/frame/avatar_button_manager.cc |
| +++ b/chrome/browser/ui/views/frame/avatar_button_manager.cc |
| @@ -4,6 +4,8 @@ |
| #include "chrome/browser/ui/views/frame/avatar_button_manager.h" |
| +#include "chrome/browser/browser_process.h" |
| +#include "chrome/browser/profiles/profile_manager.h" |
| #include "chrome/browser/ui/view_ids.h" |
| #include "chrome/browser/ui/views/frame/browser_frame.h" |
| #include "chrome/browser/ui/views/frame/browser_view.h" |
| @@ -19,8 +21,16 @@ void AvatarButtonManager::Update(AvatarButtonStyle style) { |
| // This should never be called in incognito mode. |
| DCHECK(browser_view->IsRegularOrGuestSession()); |
| + ProfileAttributesEntry* entry; |
| + bool show_avatar = |
|
Peter Kasting
2016/05/17 03:51:42
Nit: I'd just inline this into the next statement.
Evan Stade
2016/05/17 18:13:08
Done.
|
| + browser_view->IsBrowserTypeNormal() && |
| + // Tests may not have a profile manager. |
| + g_browser_process->profile_manager() && |
| + g_browser_process->profile_manager() |
| + ->GetProfileAttributesStorage() |
| + .GetProfileAttributesWithPath(profile->GetPath(), &entry); |
| - if (browser_view->ShouldShowAvatar()) { |
| + if (show_avatar) { |
| if (!view_) { |
| view_ = new NewAvatarButton(this, style, profile); |
| view_->set_id(VIEW_ID_NEW_AVATAR_BUTTON); |