OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef ASH_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 5 #ifndef ASH_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
6 #define ASH_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 6 #define ASH_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
7 | 7 |
8 #include "ash/wm/overview/scoped_overview_animation_settings.h" | 8 #include "ash/wm/overview/scoped_overview_animation_settings.h" |
9 #include "ash/wm/overview/transparent_activate_window_button.h" | 9 #include "ash/wm/overview/transparent_activate_window_button.h" |
10 #include "ash/wm/overview/transparent_activate_window_button_delegate.h" | 10 #include "ash/wm/overview/transparent_activate_window_button_delegate.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 gfx::Transform get_overview_transform() const { return overview_transform_; } | 56 gfx::Transform get_overview_transform() const { return overview_transform_; } |
57 | 57 |
58 void set_overview_transform(const gfx::Transform& transform) { | 58 void set_overview_transform(const gfx::Transform& transform) { |
59 overview_transform_ = transform; | 59 overview_transform_ = transform; |
60 } | 60 } |
61 | 61 |
62 TransparentActivateWindowButton* activate_button() { | 62 TransparentActivateWindowButton* activate_button() { |
63 return activate_button_.get(); | 63 return activate_button_.get(); |
64 } | 64 } |
65 | 65 |
66 | |
67 // Starts an animation sequence which will use animation settings specified by | 66 // Starts an animation sequence which will use animation settings specified by |
68 // |animation_type|. The |animation_settings| container is populated with | 67 // |animation_type|. The |animation_settings| container is populated with |
69 // scoped entities and the container should be destroyed at the end of the | 68 // scoped entities and the container should be destroyed at the end of the |
70 // animation sequence. | 69 // animation sequence. |
71 // | 70 // |
72 // Example: | 71 // Example: |
73 // ScopedTransformOverviewWindow overview_window(window); | 72 // ScopedTransformOverviewWindow overview_window(window); |
74 // ScopedTransformOverviewWindow::ScopedAnimationSettings scoped_settings; | 73 // ScopedTransformOverviewWindow::ScopedAnimationSettings scoped_settings; |
75 // overview_window.BeginScopedAnimation( | 74 // overview_window.BeginScopedAnimation( |
76 // OverviewAnimationType::OVERVIEW_ANIMATION_SELECTOR_ITEM_SCROLL_CANCEL, | 75 // OverviewAnimationType::OVERVIEW_ANIMATION_SELECTOR_ITEM_SCROLL_CANCEL, |
77 // &animation_settings); | 76 // &animation_settings); |
78 // // Calls to SetTransform & SetOpacity will use the same animation settings | 77 // // Calls to SetTransform & SetOpacity will use the same animation settings |
79 // // until scoped_settings is destroyed. | 78 // // until scoped_settings is destroyed. |
80 // overview_window.SetTransform(root_window, new_transform); | 79 // overview_window.SetTransform(root_window, new_transform); |
81 // overview_window.SetOpacity(1); | 80 // overview_window.SetOpacity(1); |
82 void BeginScopedAnimation( | 81 void BeginScopedAnimation( |
83 OverviewAnimationType animation_type, | 82 OverviewAnimationType animation_type, |
84 ScopedAnimationSettings* animation_settings); | 83 ScopedAnimationSettings* animation_settings); |
85 | 84 |
86 // Returns true if this window selector window contains the |target|. | 85 // Returns true if this window selector window contains the |target|. |
87 bool Contains(const aura::Window* target) const; | 86 bool Contains(const aura::Window* target) const; |
88 | 87 |
89 // Returns the original target bounds of all transformed windows. | 88 // Returns the original target bounds of all transformed windows. |
90 gfx::Rect GetTargetBoundsInScreen() const; | 89 gfx::Rect GetTargetBoundsInScreen() const; |
91 | 90 |
92 // Restores the window if it was minimized. | 91 // Restores and animates the managed window to it's non overview mode state. |
93 void RestoreWindow(); | 92 void RestoreWindow(); |
94 | 93 |
95 // Restores this window on exit rather than returning it to a minimized state | 94 // Forces the managed window to be shown (ie not hidden or minimized) when |
96 // if it was minimized on entering overview mode. | 95 // calling RestoreWindow(). |
97 void RestoreWindowOnExit(); | 96 void ShowWindowOnExit(); |
98 | |
99 // Informs the ScopedTransformOverviewWindow that the window being watched was | |
100 // destroyed. This resets the internal window pointer to avoid calling | |
101 // anything on the window at destruction time. | |
102 void OnWindowDestroyed(); | |
103 | 97 |
104 // Prepares for overview mode by doing any necessary actions before entering. | 98 // Prepares for overview mode by doing any necessary actions before entering. |
105 void PrepareForOverview(); | 99 void PrepareForOverview(); |
106 | 100 |
107 // Applies the |transform| to the overview window and all of its transient | 101 // Applies the |transform| to the overview window and all of its transient |
108 // children. | 102 // children. |
109 void SetTransform(aura::Window* root_window, | 103 void SetTransform(aura::Window* root_window, |
110 const gfx::Transform& transform); | 104 const gfx::Transform& transform); |
111 | 105 |
112 // Set's the opacity of the managed windows. | 106 // Set's the opacity of the managed windows. |
113 void SetOpacity(float opacity); | 107 void SetOpacity(float opacity); |
114 | 108 |
115 aura::Window* window() const { return window_; } | 109 aura::Window* window() const { return window_; } |
116 | 110 |
117 // Closes the transient root of the window managed by |this|. | 111 // Closes the transient root of the window managed by |this|. |
118 void Close(); | 112 void Close(); |
119 | 113 |
120 // ash::TransparentActivateWindowButtonDelegate: | 114 // ash::TransparentActivateWindowButtonDelegate: |
121 void Select() override; | 115 void Select() override; |
122 | 116 |
123 private: | 117 private: |
| 118 // Shows the window if it was minimized. |
| 119 void ShowWindowIfMinimized(); |
| 120 |
124 // A weak pointer to the real window in the overview. | 121 // A weak pointer to the real window in the overview. |
125 aura::Window* window_; | 122 aura::Window* window_; |
126 | 123 |
127 // The transparent overlay that captures events. | 124 // The transparent overlay that captures events. |
128 scoped_ptr<TransparentActivateWindowButton> activate_button_; | 125 scoped_ptr<TransparentActivateWindowButton> activate_button_; |
129 | 126 |
130 // If true, the window was minimized and should be restored if the window | 127 // If true, the window was minimized and should be restored if the window |
131 // was not selected. | 128 // was not selected. |
132 bool minimized_; | 129 bool minimized_; |
133 | 130 |
(...skipping 12 matching lines...) Expand all Loading... |
146 | 143 |
147 // The original opacity of the window before entering overview mode. | 144 // The original opacity of the window before entering overview mode. |
148 float original_opacity_; | 145 float original_opacity_; |
149 | 146 |
150 DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow); | 147 DISALLOW_COPY_AND_ASSIGN(ScopedTransformOverviewWindow); |
151 }; | 148 }; |
152 | 149 |
153 } // namespace ash | 150 } // namespace ash |
154 | 151 |
155 #endif // ASH_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ | 152 #endif // ASH_WM_OVERVIEW_SCOPED_TRANSFORM_OVERVIEW_WINDOW_H_ |
OLD | NEW |