Chromium Code Reviews| Index: ash/frame/default_header_painter.cc |
| diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc |
| index d76096190a20796f31f46cc5c23e1757bb7f3887..c1285f96d8fd5dc43f25492f30316855fb0d64e3 100644 |
| --- a/ash/frame/default_header_painter.cc |
| +++ b/ash/frame/default_header_painter.cc |
| @@ -77,6 +77,7 @@ DefaultHeaderPainter::DefaultHeaderPainter() |
| : frame_(NULL), |
| view_(NULL), |
| window_icon_(NULL), |
| + window_icon_size_(HeaderPainterUtil::GetIconSize()), |
|
pkotwicz
2014/03/18 15:29:44
It might make sense to rename HeaderPainterUtil::G
oshima
2014/03/18 16:59:50
Done.
|
| caption_button_container_(NULL), |
| height_(0), |
| mode_(MODE_INACTIVE), |
| @@ -217,10 +218,10 @@ void DefaultHeaderPainter::LayoutHeader() { |
| if (window_icon_) { |
| // Vertically center the window icon with respect to the caption button |
| // container. |
| - int icon_size = HeaderPainterUtil::GetIconSize(); |
| - int icon_offset_y = (caption_button_container_->height() - icon_size) / 2; |
| + int icon_offset_y = |
| + (caption_button_container_->height() - window_icon_size_) / 2; |
| window_icon_->SetBounds(HeaderPainterUtil::GetIconXOffset(), icon_offset_y, |
| - icon_size, icon_size); |
| + window_icon_size_, window_icon_size_); |
| } |
| SetHeaderHeightForPainting(caption_button_container_->height() + |
| @@ -239,6 +240,12 @@ void DefaultHeaderPainter::SchedulePaintForTitle() { |
| view_->SchedulePaintInRect(GetTitleBounds()); |
| } |
| +void DefaultHeaderPainter::UpdateWindowIcon(views::View* window_icon, |
| + int window_icon_size) { |
| + window_icon_ = window_icon; |
| + window_icon_size_ = window_icon_size; |
| +} |
| + |
| /////////////////////////////////////////////////////////////////////////////// |
| // gfx::AnimationDelegate overrides: |