| Index: ash/wm/panels/panel_frame_view.cc
|
| diff --git a/ash/wm/panels/panel_frame_view.cc b/ash/wm/panels/panel_frame_view.cc
|
| index 9188dc8cb41081e730fa9e70b97878fbc6bea484..210435e73b75a606c46dd453e292d4b43e0cb1ba 100644
|
| --- a/ash/wm/panels/panel_frame_view.cc
|
| +++ b/ash/wm/panels/panel_frame_view.cc
|
| @@ -5,14 +5,13 @@
|
| #include "ash/wm/panels/panel_frame_view.h"
|
|
|
| #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
|
| +#include "ash/frame/default_header_painter.h"
|
| #include "ash/frame/frame_border_hit_test_controller.h"
|
| -#include "ash/frame/header_painter.h"
|
| #include "grit/ash_resources.h"
|
| #include "ui/base/hit_test.h"
|
| #include "ui/base/l10n/l10n_util.h"
|
| #include "ui/gfx/canvas.h"
|
| #include "ui/views/controls/image_view.h"
|
| -#include "ui/views/widget/native_widget_aura.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/widget/widget_delegate.h"
|
|
|
| @@ -25,7 +24,6 @@ PanelFrameView::PanelFrameView(views::Widget* frame, FrameType frame_type)
|
| : frame_(frame),
|
| caption_button_container_(NULL),
|
| window_icon_(NULL),
|
| - title_font_list_(views::NativeWidgetAura::GetWindowTitleFontList()),
|
| frame_border_hit_test_controller_(
|
| new FrameBorderHitTestController(frame_)) {
|
| DCHECK(!frame_->widget_delegate()->CanMaximize());
|
| @@ -41,7 +39,7 @@ const char* PanelFrameView::GetClassName() const {
|
| }
|
|
|
| void PanelFrameView::InitHeaderPainter() {
|
| - header_painter_.reset(new HeaderPainter);
|
| + header_painter_.reset(new DefaultHeaderPainter);
|
|
|
| caption_button_container_ = new FrameCaptionButtonContainerView(frame_,
|
| FrameCaptionButtonContainerView::MINIMIZE_ALLOWED);
|
| @@ -52,16 +50,13 @@ void PanelFrameView::InitHeaderPainter() {
|
| AddChildView(window_icon_);
|
| }
|
|
|
| - header_painter_->Init(HeaderPainter::STYLE_OTHER, frame_, this, window_icon_,
|
| - caption_button_container_);
|
| + header_painter_->Init(frame_, this, window_icon_, caption_button_container_);
|
| }
|
|
|
| int PanelFrameView::NonClientTopBorderHeight() const {
|
| if (!header_painter_)
|
| return 0;
|
| - // Reserve enough space to see the buttons and the separator line.
|
| - return caption_button_container_->bounds().bottom() +
|
| - header_painter_->HeaderContentSeparatorSize();
|
| + return header_painter_->GetHeaderHeightForPainting();
|
| }
|
|
|
| gfx::Size PanelFrameView::GetMinimumSize() {
|
| @@ -78,7 +73,6 @@ void PanelFrameView::Layout() {
|
| if (!header_painter_)
|
| return;
|
| header_painter_->LayoutHeader();
|
| - header_painter_->set_header_height(NonClientTopBorderHeight());
|
| }
|
|
|
| void PanelFrameView::GetWindowMask(const gfx::Size&, gfx::Path*) {
|
| @@ -101,14 +95,14 @@ void PanelFrameView::UpdateWindowIcon() {
|
| void PanelFrameView::UpdateWindowTitle() {
|
| if (!header_painter_)
|
| return;
|
| - header_painter_->SchedulePaintForTitle(title_font_list_);
|
| + header_painter_->SchedulePaintForTitle();
|
| }
|
|
|
| int PanelFrameView::NonClientHitTest(const gfx::Point& point) {
|
| if (!header_painter_)
|
| return HTNOWHERE;
|
| return FrameBorderHitTestController::NonClientHitTest(this,
|
| - header_painter_.get(), point);
|
| + caption_button_container_, point);
|
| }
|
|
|
| void PanelFrameView::OnPaint(gfx::Canvas* canvas) {
|
| @@ -117,32 +111,22 @@ void PanelFrameView::OnPaint(gfx::Canvas* canvas) {
|
| bool paint_as_active = ShouldPaintAsActive();
|
| caption_button_container_->SetPaintAsActive(paint_as_active);
|
|
|
| - int theme_frame_id = 0;
|
| - if (paint_as_active)
|
| - theme_frame_id = IDR_AURA_WINDOW_HEADER_BASE_ACTIVE;
|
| - else
|
| - theme_frame_id = IDR_AURA_WINDOW_HEADER_BASE_INACTIVE;
|
| -
|
| HeaderPainter::Mode header_mode = paint_as_active ?
|
| HeaderPainter::MODE_ACTIVE : HeaderPainter::MODE_INACTIVE;
|
| - header_painter_->PaintHeader(canvas, header_mode, theme_frame_id, 0);
|
| - header_painter_->PaintTitleBar(canvas, title_font_list_);
|
| - header_painter_->PaintHeaderContentSeparator(canvas, header_mode);
|
| + header_painter_->PaintHeader(canvas, header_mode);
|
| }
|
|
|
| gfx::Rect PanelFrameView::GetBoundsForClientView() const {
|
| - if (!header_painter_)
|
| - return bounds();
|
| - return HeaderPainter::GetBoundsForClientView(
|
| - NonClientTopBorderHeight(), bounds());
|
| + gfx::Rect client_bounds = bounds();
|
| + client_bounds.Inset(0, NonClientTopBorderHeight(), 0, 0);
|
| + return client_bounds;
|
| }
|
|
|
| gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds(
|
| const gfx::Rect& client_bounds) const {
|
| - if (!header_painter_)
|
| - return client_bounds;
|
| - return HeaderPainter::GetWindowBoundsForClientBounds(
|
| - NonClientTopBorderHeight(), client_bounds);
|
| + gfx::Rect window_bounds = client_bounds;
|
| + window_bounds.Inset(0, -NonClientTopBorderHeight(), 0, 0);
|
| + return window_bounds;
|
| }
|
|
|
| } // namespace ash
|
|
|