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/wm/panels/panel_frame_view.h" | 5 #include "ash/wm/panels/panel_frame_view.h" |
6 | 6 |
7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 7 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
8 #include "ash/wm/frame_border_hit_test_controller.h" | 8 #include "ash/wm/frame_border_hit_test_controller.h" |
9 #include "ash/wm/header_painter.h" | 9 #include "ash/wm/header_painter.h" |
10 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 if (!header_painter_) | 108 if (!header_painter_) |
109 return HTNOWHERE; | 109 return HTNOWHERE; |
110 return FrameBorderHitTestController::NonClientHitTest(this, | 110 return FrameBorderHitTestController::NonClientHitTest(this, |
111 header_painter_.get(), point); | 111 header_painter_.get(), point); |
112 } | 112 } |
113 | 113 |
114 void PanelFrameView::OnPaint(gfx::Canvas* canvas) { | 114 void PanelFrameView::OnPaint(gfx::Canvas* canvas) { |
115 if (!header_painter_) | 115 if (!header_painter_) |
116 return; | 116 return; |
117 bool paint_as_active = ShouldPaintAsActive(); | 117 bool paint_as_active = ShouldPaintAsActive(); |
| 118 caption_button_container_->SetPaintAsActive(paint_as_active); |
| 119 |
118 int theme_frame_id = 0; | 120 int theme_frame_id = 0; |
119 if (paint_as_active) | 121 if (paint_as_active) |
120 theme_frame_id = IDR_AURA_BROWSER_WINDOW_HEADER_BASE_RESTORED_ACTIVE; | 122 theme_frame_id = IDR_AURA_WINDOW_HEADER_BASE_ACTIVE; |
121 else | 123 else |
122 theme_frame_id = IDR_AURA_BROWSER_WINDOW_HEADER_BASE_RESTORED_INACTIVE; | 124 theme_frame_id = IDR_AURA_WINDOW_HEADER_BASE_INACTIVE; |
123 | 125 |
124 header_painter_->PaintHeader( | 126 HeaderPainter::Mode header_mode = paint_as_active ? |
125 canvas, | 127 HeaderPainter::MODE_ACTIVE : HeaderPainter::MODE_INACTIVE; |
126 theme_frame_id, | 128 header_painter_->PaintHeader(canvas, header_mode, theme_frame_id, 0); |
127 0); | |
128 header_painter_->PaintTitleBar(canvas, title_font_list_); | 129 header_painter_->PaintTitleBar(canvas, title_font_list_); |
129 header_painter_->PaintHeaderContentSeparator(canvas); | 130 header_painter_->PaintHeaderContentSeparator(canvas, header_mode); |
130 } | 131 } |
131 | 132 |
132 gfx::Rect PanelFrameView::GetBoundsForClientView() const { | 133 gfx::Rect PanelFrameView::GetBoundsForClientView() const { |
133 if (!header_painter_) | 134 if (!header_painter_) |
134 return bounds(); | 135 return bounds(); |
135 return HeaderPainter::GetBoundsForClientView( | 136 return HeaderPainter::GetBoundsForClientView( |
136 NonClientTopBorderHeight(), bounds()); | 137 NonClientTopBorderHeight(), bounds()); |
137 } | 138 } |
138 | 139 |
139 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( | 140 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( |
140 const gfx::Rect& client_bounds) const { | 141 const gfx::Rect& client_bounds) const { |
141 if (!header_painter_) | 142 if (!header_painter_) |
142 return client_bounds; | 143 return client_bounds; |
143 return HeaderPainter::GetWindowBoundsForClientBounds( | 144 return HeaderPainter::GetWindowBoundsForClientBounds( |
144 NonClientTopBorderHeight(), client_bounds); | 145 NonClientTopBorderHeight(), client_bounds); |
145 } | 146 } |
146 | 147 |
147 } // namespace ash | 148 } // namespace ash |
OLD | NEW |