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 "ash/wm/window_state.h" |
10 #include "grit/ash_resources.h" | 11 #include "grit/ash_resources.h" |
11 #include "ui/base/hit_test.h" | 12 #include "ui/base/hit_test.h" |
12 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
13 #include "ui/gfx/canvas.h" | 14 #include "ui/gfx/canvas.h" |
14 #include "ui/gfx/font.h" | 15 #include "ui/gfx/font.h" |
15 #include "ui/views/controls/image_view.h" | 16 #include "ui/views/controls/image_view.h" |
16 #include "ui/views/widget/native_widget_aura.h" | 17 #include "ui/views/widget/native_widget_aura.h" |
17 #include "ui/views/widget/widget.h" | 18 #include "ui/views/widget/widget.h" |
18 #include "ui/views/widget/widget_delegate.h" | 19 #include "ui/views/widget/widget_delegate.h" |
19 | 20 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 NonClientTopBorderHeight() + min_client_view_size.height()); | 74 NonClientTopBorderHeight() + min_client_view_size.height()); |
74 } | 75 } |
75 | 76 |
76 void PanelFrameView::Layout() { | 77 void PanelFrameView::Layout() { |
77 if (!header_painter_) | 78 if (!header_painter_) |
78 return; | 79 return; |
79 header_painter_->LayoutHeader(true); | 80 header_painter_->LayoutHeader(true); |
80 header_painter_->set_header_height(NonClientTopBorderHeight()); | 81 header_painter_->set_header_height(NonClientTopBorderHeight()); |
81 } | 82 } |
82 | 83 |
| 84 void PanelFrameView::GetWindowMask(const gfx::Size&, gfx::Path*) { |
| 85 // Nothing. |
| 86 } |
| 87 |
83 void PanelFrameView::ResetWindowControls() { | 88 void PanelFrameView::ResetWindowControls() { |
84 NOTIMPLEMENTED(); | 89 NOTIMPLEMENTED(); |
85 } | 90 } |
86 | 91 |
87 void PanelFrameView::UpdateWindowIcon() { | 92 void PanelFrameView::UpdateWindowIcon() { |
88 if (!window_icon_) | 93 if (!window_icon_) |
89 return; | 94 return; |
90 views::WidgetDelegate* delegate = frame_->widget_delegate(); | 95 views::WidgetDelegate* delegate = frame_->widget_delegate(); |
91 if (delegate) | 96 if (delegate) |
92 window_icon_->SetImage(delegate->GetWindowIcon()); | 97 window_icon_->SetImage(delegate->GetWindowIcon()); |
93 window_icon_->SchedulePaint(); | 98 window_icon_->SchedulePaint(); |
94 } | 99 } |
95 | 100 |
96 void PanelFrameView::UpdateWindowTitle() { | 101 void PanelFrameView::UpdateWindowTitle() { |
97 if (!header_painter_) | 102 if (!header_painter_) |
98 return; | 103 return; |
99 header_painter_->SchedulePaintForTitle(title_font_); | 104 header_painter_->SchedulePaintForTitle(title_font_); |
100 } | 105 } |
101 | 106 |
102 void PanelFrameView::GetWindowMask(const gfx::Size&, gfx::Path*) { | 107 bool PanelFrameView::IsDocked() const { |
103 // Nothing. | 108 return ash::wm::GetWindowState(frame_->GetNativeWindow())->IsDocked(); |
104 } | 109 } |
105 | 110 |
106 int PanelFrameView::NonClientHitTest(const gfx::Point& point) { | 111 int PanelFrameView::NonClientHitTest(const gfx::Point& point) { |
107 if (!header_painter_) | 112 if (!header_painter_) |
108 return HTNOWHERE; | 113 return HTNOWHERE; |
109 return FrameBorderHitTestController::NonClientHitTest(this, | 114 return FrameBorderHitTestController::NonClientHitTest(this, |
110 header_painter_.get(), point); | 115 header_painter_.get(), point); |
111 } | 116 } |
112 | 117 |
113 void PanelFrameView::OnPaint(gfx::Canvas* canvas) { | 118 void PanelFrameView::OnPaint(gfx::Canvas* canvas) { |
(...skipping 26 matching lines...) Expand all Loading... |
140 | 145 |
141 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( | 146 gfx::Rect PanelFrameView::GetWindowBoundsForClientBounds( |
142 const gfx::Rect& client_bounds) const { | 147 const gfx::Rect& client_bounds) const { |
143 if (!header_painter_) | 148 if (!header_painter_) |
144 return client_bounds; | 149 return client_bounds; |
145 return HeaderPainter::GetWindowBoundsForClientBounds( | 150 return HeaderPainter::GetWindowBoundsForClientBounds( |
146 NonClientTopBorderHeight(), client_bounds); | 151 NonClientTopBorderHeight(), client_bounds); |
147 } | 152 } |
148 | 153 |
149 } // namespace ash | 154 } // namespace ash |
OLD | NEW |