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/ash_switches.h" | 10 #include "ash/ash_switches.h" |
| 11 #include "ash/aura/wm_window_aura.h" |
11 #include "ash/common/wm/window_state.h" | 12 #include "ash/common/wm/window_state.h" |
12 #include "ash/common/wm/window_state_delegate.h" | 13 #include "ash/common/wm/window_state_delegate.h" |
13 #include "ash/common/wm/window_state_observer.h" | 14 #include "ash/common/wm/window_state_observer.h" |
14 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" | 15 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h" |
15 #include "ash/frame/default_header_painter.h" | 16 #include "ash/frame/default_header_painter.h" |
16 #include "ash/frame/frame_border_hit_test_controller.h" | 17 #include "ash/frame/frame_border_hit_test_controller.h" |
17 #include "ash/frame/header_painter.h" | 18 #include "ash/frame/header_painter.h" |
18 #include "ash/session/session_state_delegate.h" | 19 #include "ash/session/session_state_delegate.h" |
19 #include "ash/shell.h" | 20 #include "ash/shell.h" |
20 #include "ash/shell_observer.h" | 21 #include "ash/shell_observer.h" |
21 #include "ash/wm/aura/wm_window_aura.h" | |
22 #include "ash/wm/immersive_fullscreen_controller.h" | 22 #include "ash/wm/immersive_fullscreen_controller.h" |
23 #include "ash/wm/window_state_aura.h" | 23 #include "ash/wm/window_state_aura.h" |
24 #include "base/command_line.h" | 24 #include "base/command_line.h" |
25 #include "ui/aura/client/aura_constants.h" | 25 #include "ui/aura/client/aura_constants.h" |
26 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
27 #include "ui/aura/window_observer.h" | 27 #include "ui/aura/window_observer.h" |
28 #include "ui/gfx/canvas.h" | 28 #include "ui/gfx/canvas.h" |
29 #include "ui/gfx/geometry/rect.h" | 29 #include "ui/gfx/geometry/rect.h" |
30 #include "ui/gfx/geometry/rect_conversions.h" | 30 #include "ui/gfx/geometry/rect_conversions.h" |
31 #include "ui/gfx/geometry/size.h" | 31 #include "ui/gfx/geometry/size.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 GetAuraWindow()->AddObserver(this); | 68 GetAuraWindow()->AddObserver(this); |
69 } | 69 } |
70 ~CustomFrameViewAshWindowStateDelegate() override { | 70 ~CustomFrameViewAshWindowStateDelegate() override { |
71 if (window_state_) { | 71 if (window_state_) { |
72 window_state_->RemoveObserver(this); | 72 window_state_->RemoveObserver(this); |
73 GetAuraWindow()->RemoveObserver(this); | 73 GetAuraWindow()->RemoveObserver(this); |
74 } | 74 } |
75 } | 75 } |
76 private: | 76 private: |
77 aura::Window* GetAuraWindow() { | 77 aura::Window* GetAuraWindow() { |
78 return ash::wm::WmWindowAura::GetAuraWindow(window_state_->window()); | 78 return ash::WmWindowAura::GetAuraWindow(window_state_->window()); |
79 } | 79 } |
80 | 80 |
81 // Overridden from ash::wm::WindowStateDelegate: | 81 // Overridden from ash::wm::WindowStateDelegate: |
82 bool ToggleFullscreen(ash::wm::WindowState* window_state) override { | 82 bool ToggleFullscreen(ash::wm::WindowState* window_state) override { |
83 bool enter_fullscreen = !window_state->IsFullscreen(); | 83 bool enter_fullscreen = !window_state->IsFullscreen(); |
84 if (enter_fullscreen) { | 84 if (enter_fullscreen) { |
85 GetAuraWindow()->SetProperty(aura::client::kShowStateKey, | 85 GetAuraWindow()->SetProperty(aura::client::kShowStateKey, |
86 ui::SHOW_STATE_FULLSCREEN); | 86 ui::SHOW_STATE_FULLSCREEN); |
87 } else { | 87 } else { |
88 window_state->Restore(); | 88 window_state->Restore(); |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 FrameCaptionButtonContainerView* CustomFrameViewAsh:: | 592 FrameCaptionButtonContainerView* CustomFrameViewAsh:: |
593 GetFrameCaptionButtonContainerViewForTest() { | 593 GetFrameCaptionButtonContainerViewForTest() { |
594 return header_view_->caption_button_container(); | 594 return header_view_->caption_button_container(); |
595 } | 595 } |
596 | 596 |
597 int CustomFrameViewAsh::NonClientTopBorderHeight() const { | 597 int CustomFrameViewAsh::NonClientTopBorderHeight() const { |
598 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); | 598 return frame_->IsFullscreen() ? 0 : header_view_->GetPreferredHeight(); |
599 } | 599 } |
600 | 600 |
601 } // namespace ash | 601 } // namespace ash |
OLD | NEW |