| 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/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/material_design/material_design_controller.h" | 10 #include "ash/common/material_design/material_design_controller.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 WmShell::Get()->AddShellObserver(this); | 34 WmShell::Get()->AddShellObserver(this); |
| 35 } | 35 } |
| 36 | 36 |
| 37 PanelFrameView::~PanelFrameView() { | 37 PanelFrameView::~PanelFrameView() { |
| 38 WmShell::Get()->RemoveShellObserver(this); | 38 WmShell::Get()->RemoveShellObserver(this); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void PanelFrameView::SetFrameColors(SkColor active_frame_color, | 41 void PanelFrameView::SetFrameColors(SkColor active_frame_color, |
| 42 SkColor inactive_frame_color) { | 42 SkColor inactive_frame_color) { |
| 43 header_painter_->SetFrameColors(active_frame_color, inactive_frame_color); | 43 header_painter_->SetFrameColors(active_frame_color, inactive_frame_color); |
| 44 frame_->GetNativeWindow()->SetProperty( |
| 45 aura::client::kTopViewColor, header_painter_->GetInactiveFrameColor()); |
| 44 } | 46 } |
| 45 | 47 |
| 46 const char* PanelFrameView::GetClassName() const { | 48 const char* PanelFrameView::GetClassName() const { |
| 47 return kViewClassName; | 49 return kViewClassName; |
| 48 } | 50 } |
| 49 | 51 |
| 50 void PanelFrameView::InitHeaderPainter() { | 52 void PanelFrameView::InitHeaderPainter() { |
| 51 header_painter_.reset(new DefaultHeaderPainter); | 53 header_painter_.reset(new DefaultHeaderPainter); |
| 54 frame_->GetNativeWindow()->SetProperty( |
| 55 aura::client::kTopViewColor, header_painter_->GetInactiveFrameColor()); |
| 52 | 56 |
| 53 caption_button_container_ = new FrameCaptionButtonContainerView(frame_); | 57 caption_button_container_ = new FrameCaptionButtonContainerView(frame_); |
| 54 AddChildView(caption_button_container_); | 58 AddChildView(caption_button_container_); |
| 55 | 59 |
| 56 header_painter_->Init(frame_, this, caption_button_container_); | 60 header_painter_->Init(frame_, this, caption_button_container_); |
| 57 | 61 |
| 58 if (frame_->widget_delegate()->ShouldShowWindowIcon()) { | 62 if (frame_->widget_delegate()->ShouldShowWindowIcon()) { |
| 59 window_icon_ = new views::ImageView(); | 63 window_icon_ = new views::ImageView(); |
| 60 AddChildView(window_icon_); | 64 AddChildView(window_icon_); |
| 61 header_painter_->UpdateLeftHeaderView(window_icon_); | 65 header_painter_->UpdateLeftHeaderView(window_icon_); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (ash::MaterialDesignController::IsOverviewMaterial()) | 152 if (ash::MaterialDesignController::IsOverviewMaterial()) |
| 149 caption_button_container_->SetVisible(false); | 153 caption_button_container_->SetVisible(false); |
| 150 } | 154 } |
| 151 | 155 |
| 152 void PanelFrameView::OnOverviewModeEnded() { | 156 void PanelFrameView::OnOverviewModeEnded() { |
| 153 if (ash::MaterialDesignController::IsOverviewMaterial()) | 157 if (ash::MaterialDesignController::IsOverviewMaterial()) |
| 154 caption_button_container_->SetVisible(true); | 158 caption_button_container_->SetVisible(true); |
| 155 } | 159 } |
| 156 | 160 |
| 157 } // namespace ash | 161 } // namespace ash |
| OLD | NEW |