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/common/wm/panels/panel_frame_view.h" | 5 #include "ash/common/wm/panels/panel_frame_view.h" |
6 | 6 |
7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" | 7 #include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h
" |
8 #include "ash/common/frame/default_header_painter.h" | 8 #include "ash/common/frame/default_header_painter.h" |
9 #include "ash/common/frame/frame_border_hit_test.h" | 9 #include "ash/common/frame/frame_border_hit_test.h" |
10 #include "ash/common/wm_shell.h" | |
11 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
| 11 #include "ash/shell.h" |
12 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
14 #include "ui/base/hit_test.h" | 14 #include "ui/base/hit_test.h" |
15 #include "ui/gfx/canvas.h" | 15 #include "ui/gfx/canvas.h" |
16 #include "ui/views/controls/image_view.h" | 16 #include "ui/views/controls/image_view.h" |
17 #include "ui/views/widget/widget.h" | 17 #include "ui/views/widget/widget.h" |
18 #include "ui/views/widget/widget_delegate.h" | 18 #include "ui/views/widget/widget_delegate.h" |
19 | 19 |
20 namespace ash { | 20 namespace ash { |
21 | 21 |
22 // static | 22 // static |
23 const char PanelFrameView::kViewClassName[] = "PanelFrameView"; | 23 const char PanelFrameView::kViewClassName[] = "PanelFrameView"; |
24 | 24 |
25 PanelFrameView::PanelFrameView(views::Widget* frame, FrameType frame_type) | 25 PanelFrameView::PanelFrameView(views::Widget* frame, FrameType frame_type) |
26 : frame_(frame), caption_button_container_(nullptr), window_icon_(nullptr) { | 26 : frame_(frame), caption_button_container_(nullptr), window_icon_(nullptr) { |
27 GetWidgetWindow()->InstallResizeHandleWindowTargeter(nullptr); | 27 GetWidgetWindow()->InstallResizeHandleWindowTargeter(nullptr); |
28 DCHECK(!frame_->widget_delegate()->CanMaximize()); | 28 DCHECK(!frame_->widget_delegate()->CanMaximize()); |
29 if (frame_type != FRAME_NONE) | 29 if (frame_type != FRAME_NONE) |
30 InitHeaderPainter(); | 30 InitHeaderPainter(); |
31 WmShell::Get()->AddShellObserver(this); | 31 Shell::GetInstance()->AddShellObserver(this); |
32 } | 32 } |
33 | 33 |
34 PanelFrameView::~PanelFrameView() { | 34 PanelFrameView::~PanelFrameView() { |
35 WmShell::Get()->RemoveShellObserver(this); | 35 Shell::GetInstance()->RemoveShellObserver(this); |
36 } | 36 } |
37 | 37 |
38 void PanelFrameView::SetFrameColors(SkColor active_frame_color, | 38 void PanelFrameView::SetFrameColors(SkColor active_frame_color, |
39 SkColor inactive_frame_color) { | 39 SkColor inactive_frame_color) { |
40 header_painter_->SetFrameColors(active_frame_color, inactive_frame_color); | 40 header_painter_->SetFrameColors(active_frame_color, inactive_frame_color); |
41 GetWidgetWindow()->aura_window()->SetProperty( | 41 GetWidgetWindow()->aura_window()->SetProperty( |
42 aura::client::kTopViewColor, header_painter_->GetInactiveFrameColor()); | 42 aura::client::kTopViewColor, header_painter_->GetInactiveFrameColor()); |
43 } | 43 } |
44 | 44 |
45 const char* PanelFrameView::GetClassName() const { | 45 const char* PanelFrameView::GetClassName() const { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 151 |
152 void PanelFrameView::OnOverviewModeStarting() { | 152 void PanelFrameView::OnOverviewModeStarting() { |
153 caption_button_container_->SetVisible(false); | 153 caption_button_container_->SetVisible(false); |
154 } | 154 } |
155 | 155 |
156 void PanelFrameView::OnOverviewModeEnded() { | 156 void PanelFrameView::OnOverviewModeEnded() { |
157 caption_button_container_->SetVisible(true); | 157 caption_button_container_->SetVisible(true); |
158 } | 158 } |
159 | 159 |
160 } // namespace ash | 160 } // namespace ash |
OLD | NEW |