| 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/frame/custom_frame_view_ash.h" | 5 #include "ash/frame/custom_frame_view_ash.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/aura/wm_window_aura.h" | 10 #include "ash/aura/wm_window_aura.h" |
| 11 #include "ash/common/ash_switches.h" | 11 #include "ash/common/ash_switches.h" |
| 12 #include "ash/common/material_design/material_design_controller.h" |
| 12 #include "ash/common/session/session_state_delegate.h" | 13 #include "ash/common/session/session_state_delegate.h" |
| 13 #include "ash/common/shell_observer.h" | 14 #include "ash/common/shell_observer.h" |
| 14 #include "ash/common/wm/window_state.h" | 15 #include "ash/common/wm/window_state.h" |
| 15 #include "ash/common/wm/window_state_delegate.h" | 16 #include "ash/common/wm/window_state_delegate.h" |
| 16 #include "ash/common/wm/window_state_observer.h" | 17 #include "ash/common/wm/window_state_observer.h" |
| 17 #include "ash/common/wm_lookup.h" | 18 #include "ash/common/wm_lookup.h" |
| 18 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
| 19 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 20 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
| 20 #include "ash/frame/default_header_painter.h" | 21 #include "ash/frame/default_header_painter.h" |
| 21 #include "ash/frame/frame_border_hit_test_controller.h" | 22 #include "ash/frame/frame_border_hit_test_controller.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); | 161 void SetFrameColors(SkColor active_frame_color, SkColor inactive_frame_color); |
| 161 | 162 |
| 162 // views::View: | 163 // views::View: |
| 163 void Layout() override; | 164 void Layout() override; |
| 164 void OnPaint(gfx::Canvas* canvas) override; | 165 void OnPaint(gfx::Canvas* canvas) override; |
| 165 void ChildPreferredSizeChanged(views::View* child) override; | 166 void ChildPreferredSizeChanged(views::View* child) override; |
| 166 | 167 |
| 167 // ShellObserver: | 168 // ShellObserver: |
| 168 void OnMaximizeModeStarted() override; | 169 void OnMaximizeModeStarted() override; |
| 169 void OnMaximizeModeEnded() override; | 170 void OnMaximizeModeEnded() override; |
| 171 void OnOverviewModeStarting() override; |
| 172 void OnOverviewModeEnded() override; |
| 170 | 173 |
| 171 FrameCaptionButtonContainerView* caption_button_container() { | 174 FrameCaptionButtonContainerView* caption_button_container() { |
| 172 return caption_button_container_; | 175 return caption_button_container_; |
| 173 } | 176 } |
| 174 | 177 |
| 175 views::View* avatar_icon() const { return avatar_icon_; } | 178 views::View* avatar_icon() const { return avatar_icon_; } |
| 176 | 179 |
| 177 private: | 180 private: |
| 178 // ImmersiveFullscreenController::Delegate: | 181 // ImmersiveFullscreenController::Delegate: |
| 179 void OnImmersiveRevealStarted() override; | 182 void OnImmersiveRevealStarted() override; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 void CustomFrameViewAsh::HeaderView::OnMaximizeModeStarted() { | 316 void CustomFrameViewAsh::HeaderView::OnMaximizeModeStarted() { |
| 314 caption_button_container_->UpdateSizeButtonVisibility(); | 317 caption_button_container_->UpdateSizeButtonVisibility(); |
| 315 parent()->Layout(); | 318 parent()->Layout(); |
| 316 } | 319 } |
| 317 | 320 |
| 318 void CustomFrameViewAsh::HeaderView::OnMaximizeModeEnded() { | 321 void CustomFrameViewAsh::HeaderView::OnMaximizeModeEnded() { |
| 319 caption_button_container_->UpdateSizeButtonVisibility(); | 322 caption_button_container_->UpdateSizeButtonVisibility(); |
| 320 parent()->Layout(); | 323 parent()->Layout(); |
| 321 } | 324 } |
| 322 | 325 |
| 326 void CustomFrameViewAsh::HeaderView::OnOverviewModeStarting() { |
| 327 if (ash::MaterialDesignController::IsOverviewMaterial()) |
| 328 SetVisible(false); |
| 329 } |
| 330 |
| 331 void CustomFrameViewAsh::HeaderView::OnOverviewModeEnded() { |
| 332 if (ash::MaterialDesignController::IsOverviewMaterial()) |
| 333 SetVisible(true); |
| 334 } |
| 335 |
| 323 /////////////////////////////////////////////////////////////////////////////// | 336 /////////////////////////////////////////////////////////////////////////////// |
| 324 // CustomFrameViewAsh::HeaderView, | 337 // CustomFrameViewAsh::HeaderView, |
| 325 // ImmersiveFullscreenController::Delegate overrides: | 338 // ImmersiveFullscreenController::Delegate overrides: |
| 326 | 339 |
| 327 void CustomFrameViewAsh::HeaderView::OnImmersiveRevealStarted() { | 340 void CustomFrameViewAsh::HeaderView::OnImmersiveRevealStarted() { |
| 328 fullscreen_visible_fraction_ = 0; | 341 fullscreen_visible_fraction_ = 0; |
| 329 SetPaintToLayer(true); | 342 SetPaintToLayer(true); |
| 330 layer()->SetFillsBoundsOpaquely(false); | 343 layer()->SetFillsBoundsOpaquely(false); |
| 331 parent()->Layout(); | 344 parent()->Layout(); |
| 332 } | 345 } |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 FrameCaptionButtonContainerView* | 602 FrameCaptionButtonContainerView* |
| 590 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { | 603 CustomFrameViewAsh::GetFrameCaptionButtonContainerViewForTest() { |
| 591 return header_view_->caption_button_container(); | 604 return header_view_->caption_button_container(); |
| 592 } | 605 } |
| 593 | 606 |
| 594 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 607 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
| 595 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); | 608 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); |
| 596 } | 609 } |
| 597 | 610 |
| 598 } // namespace ash | 611 } // namespace ash |
| OLD | NEW |