| 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, |
| 46 static_cast<int>(header_painter_->GetInactiveFrameColor())); |
| 44 } | 47 } |
| 45 | 48 |
| 46 const char* PanelFrameView::GetClassName() const { | 49 const char* PanelFrameView::GetClassName() const { |
| 47 return kViewClassName; | 50 return kViewClassName; |
| 48 } | 51 } |
| 49 | 52 |
| 50 void PanelFrameView::InitHeaderPainter() { | 53 void PanelFrameView::InitHeaderPainter() { |
| 51 header_painter_.reset(new DefaultHeaderPainter); | 54 header_painter_.reset(new DefaultHeaderPainter); |
| 55 frame_->GetNativeWindow()->SetProperty( |
| 56 aura::client::kTopViewColor, |
| 57 static_cast<int>(header_painter_->GetInactiveFrameColor())); |
| 52 | 58 |
| 53 caption_button_container_ = new FrameCaptionButtonContainerView(frame_); | 59 caption_button_container_ = new FrameCaptionButtonContainerView(frame_); |
| 54 AddChildView(caption_button_container_); | 60 AddChildView(caption_button_container_); |
| 55 | 61 |
| 56 header_painter_->Init(frame_, this, caption_button_container_); | 62 header_painter_->Init(frame_, this, caption_button_container_); |
| 57 | 63 |
| 58 if (frame_->widget_delegate()->ShouldShowWindowIcon()) { | 64 if (frame_->widget_delegate()->ShouldShowWindowIcon()) { |
| 59 window_icon_ = new views::ImageView(); | 65 window_icon_ = new views::ImageView(); |
| 60 AddChildView(window_icon_); | 66 AddChildView(window_icon_); |
| 61 header_painter_->UpdateLeftHeaderView(window_icon_); | 67 header_painter_->UpdateLeftHeaderView(window_icon_); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 if (ash::MaterialDesignController::IsOverviewMaterial()) | 154 if (ash::MaterialDesignController::IsOverviewMaterial()) |
| 149 caption_button_container_->SetVisible(false); | 155 caption_button_container_->SetVisible(false); |
| 150 } | 156 } |
| 151 | 157 |
| 152 void PanelFrameView::OnOverviewModeEnded() { | 158 void PanelFrameView::OnOverviewModeEnded() { |
| 153 if (ash::MaterialDesignController::IsOverviewMaterial()) | 159 if (ash::MaterialDesignController::IsOverviewMaterial()) |
| 154 caption_button_container_->SetVisible(true); | 160 caption_button_container_->SetVisible(true); |
| 155 } | 161 } |
| 156 | 162 |
| 157 } // namespace ash | 163 } // namespace ash |
| OLD | NEW |