OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 5 #ifndef ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 6 #define ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
7 | 7 |
8 #include "ash/wm/window_state.h" | 8 #include "ash/wm/window_state.h" |
9 | 9 |
10 namespace ash { | 10 namespace ash { |
(...skipping 23 matching lines...) Expand all Loading... |
34 // WindowState::State overrides: | 34 // WindowState::State overrides: |
35 virtual void OnWMEvent(wm::WindowState* window_state, | 35 virtual void OnWMEvent(wm::WindowState* window_state, |
36 const wm::WMEvent* event) OVERRIDE; | 36 const wm::WMEvent* event) OVERRIDE; |
37 | 37 |
38 virtual wm::WindowStateType GetType() const OVERRIDE; | 38 virtual wm::WindowStateType GetType() const OVERRIDE; |
39 virtual void AttachState(wm::WindowState* window_state, | 39 virtual void AttachState(wm::WindowState* window_state, |
40 wm::WindowState::State* previous_state) OVERRIDE; | 40 wm::WindowState::State* previous_state) OVERRIDE; |
41 virtual void DetachState(wm::WindowState* window_state) OVERRIDE; | 41 virtual void DetachState(wm::WindowState* window_state) OVERRIDE; |
42 | 42 |
43 private: | 43 private: |
44 // Centers the window on top of the workspace or maximizes it. If |animate| is | 44 enum ShowState { |
45 // set to true, a bounds change will be animated - otherwise immediate. | 45 MAXIMIZED_OR_CENTERED, // The window is either maximized or centered. |
46 void MaximizeOrCenterWindow(wm::WindowState* window_state, bool animate); | 46 FULL_SCREEN // The window is full screen. |
| 47 }; |
| 48 // Shows the window either fullscreen, maximized or centered on the screen - |
| 49 // dependent on flags and window capabilities. |show_state| defines if either |
| 50 // full screen or maximized / centered should be used. If |animate| is set, a |
| 51 // bounds change will be animated, otherwise it will immediately be set. |
| 52 void ShowWindow(wm::WindowState* window_state, |
| 53 ShowState show_state, |
| 54 bool animate); |
47 | 55 |
48 // Minimize the window. | 56 // Minimize the window. |
49 void Minimize(wm::WindowState* window_state); | 57 void Minimize(wm::WindowState* window_state); |
50 | 58 |
51 // The original state object of the window. | 59 // The original state object of the window. |
52 scoped_ptr<wm::WindowState::State> old_state_; | 60 scoped_ptr<wm::WindowState::State> old_state_; |
53 | 61 |
54 // The state object for this object which owns this instance. | 62 // The state object for this object which owns this instance. |
55 aura::Window* window_; | 63 aura::Window* window_; |
56 | 64 |
57 // The creator which needs to be informed when this state goes away. | 65 // The creator which needs to be informed when this state goes away. |
58 MaximizeModeWindowManager* creator_; | 66 MaximizeModeWindowManager* creator_; |
59 | 67 |
60 // The current state type. Due to the nature of this state, this can only be | 68 // The current state type. Due to the nature of this state, this can only be |
61 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. | 69 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. |
62 wm::WindowStateType current_state_type_; | 70 wm::WindowStateType current_state_type_; |
63 | 71 |
64 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); | 72 DISALLOW_COPY_AND_ASSIGN(MaximizeModeWindowState); |
65 }; | 73 }; |
66 | 74 |
67 } // namespace ash | 75 } // namespace ash |
68 | 76 |
69 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ | 77 #endif // ASH_WM_MAXIMIZE_MODE_MAXIMIZE_MODE_WINDOW_STATE_H_ |
OLD | NEW |