| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/frame/custom_frame_view_ash.h" | 5 #include "ash/frame/custom_frame_view_ash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 | 195 |
| 196 DISALLOW_COPY_AND_ASSIGN(HeaderView); | 196 DISALLOW_COPY_AND_ASSIGN(HeaderView); |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame) | 199 CustomFrameViewAsh::HeaderView::HeaderView(views::Widget* frame) |
| 200 : frame_(frame), | 200 : frame_(frame), |
| 201 header_painter_(new ash::DefaultHeaderPainter), | 201 header_painter_(new ash::DefaultHeaderPainter), |
| 202 avatar_icon_(NULL), | 202 avatar_icon_(NULL), |
| 203 caption_button_container_(NULL), | 203 caption_button_container_(NULL), |
| 204 fullscreen_visible_fraction_(0) { | 204 fullscreen_visible_fraction_(0) { |
| 205 FrameCaptionButtonContainerView::MinimizeAllowed minimize_allowed = | 205 caption_button_container_ = new FrameCaptionButtonContainerView(frame_); |
| 206 frame_->widget_delegate()->CanMinimize() ? | |
| 207 FrameCaptionButtonContainerView::MINIMIZE_ALLOWED : | |
| 208 FrameCaptionButtonContainerView::MINIMIZE_DISALLOWED; | |
| 209 caption_button_container_ = new FrameCaptionButtonContainerView(frame_, | |
| 210 minimize_allowed); | |
| 211 caption_button_container_->UpdateSizeButtonVisibility(); | 206 caption_button_container_->UpdateSizeButtonVisibility(); |
| 212 AddChildView(caption_button_container_); | 207 AddChildView(caption_button_container_); |
| 213 | 208 |
| 214 header_painter_->Init(frame_, this, caption_button_container_); | 209 header_painter_->Init(frame_, this, caption_button_container_); |
| 215 UpdateAvatarIcon(); | 210 UpdateAvatarIcon(); |
| 216 | 211 |
| 217 Shell::GetInstance()->AddShellObserver(this); | 212 Shell::GetInstance()->AddShellObserver(this); |
| 218 } | 213 } |
| 219 | 214 |
| 220 CustomFrameViewAsh::HeaderView::~HeaderView() { | 215 CustomFrameViewAsh::HeaderView::~HeaderView() { |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 FrameCaptionButtonContainerView* CustomFrameViewAsh:: | 573 FrameCaptionButtonContainerView* CustomFrameViewAsh:: |
| 579 GetFrameCaptionButtonContainerViewForTest() { | 574 GetFrameCaptionButtonContainerViewForTest() { |
| 580 return header_view_->caption_button_container(); | 575 return header_view_->caption_button_container(); |
| 581 } | 576 } |
| 582 | 577 |
| 583 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 578 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
| 584 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); | 579 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); |
| 585 } | 580 } |
| 586 | 581 |
| 587 } // namespace ash | 582 } // namespace ash |
| OLD | NEW |