| Index: ash/frame/header_view.cc
|
| diff --git a/ash/frame/header_view.cc b/ash/frame/header_view.cc
|
| index c59c5774b4fe34a00977d05bd1801c147549afc7..85d0537a3409847cbd1877eec2772623b25df57f 100644
|
| --- a/ash/frame/header_view.cc
|
| +++ b/ash/frame/header_view.cc
|
| @@ -6,11 +6,8 @@
|
|
|
| #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
|
| #include "ash/frame/default_header_painter.h"
|
| -#include "ash/session/session_state_delegate.h"
|
| #include "ash/shell.h"
|
| -#include "ash/shell_port.h"
|
| #include "ash/wm_window.h"
|
| -#include "ui/gfx/canvas.h"
|
| #include "ui/views/controls/image_view.h"
|
| #include "ui/views/widget/widget.h"
|
|
|
| @@ -29,7 +26,6 @@ HeaderView::HeaderView(views::Widget* target_widget,
|
| AddChildView(caption_button_container_);
|
|
|
| header_painter_->Init(target_widget_, this, caption_button_container_);
|
| - UpdateAvatarIcon();
|
|
|
| Shell::Get()->AddShellObserver(this);
|
| }
|
| @@ -65,23 +61,20 @@ int HeaderView::GetMinimumWidth() const {
|
| return header_painter_->GetMinimumHeaderWidth();
|
| }
|
|
|
| -void HeaderView::UpdateAvatarIcon() {
|
| - SessionStateDelegate* delegate = ShellPort::Get()->GetSessionStateDelegate();
|
| - WmWindow* window = WmWindow::Get(target_widget_->GetNativeWindow());
|
| - bool show = delegate->ShouldShowAvatar(window);
|
| +void HeaderView::SetAvatarIcon(const gfx::ImageSkia& avatar) {
|
| + const bool show = !avatar.isNull();
|
| if (!show) {
|
| if (!avatar_icon_)
|
| return;
|
| delete avatar_icon_;
|
| avatar_icon_ = nullptr;
|
| } else {
|
| - gfx::ImageSkia image = delegate->GetAvatarImageForWindow(window);
|
| - DCHECK_EQ(image.width(), image.height());
|
| + DCHECK_EQ(avatar.width(), avatar.height());
|
| if (!avatar_icon_) {
|
| avatar_icon_ = new views::ImageView();
|
| AddChildView(avatar_icon_);
|
| }
|
| - avatar_icon_->SetImage(image);
|
| + avatar_icon_->SetImage(avatar);
|
| }
|
| header_painter_->UpdateLeftHeaderView(avatar_icon_);
|
| Layout();
|
|
|