OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_WM_LOCK_WINDOW_STATE_H_ | |
6 #define ASH_WM_LOCK_WINDOW_STATE_H_ | |
7 | |
8 #include "ash/wm/window_state.h" | |
9 | |
10 namespace ash { | |
11 | |
12 // The LockWindowState implementation which reduces all possible window | |
13 // states to maximized and is applied only on lock (login) window container. | |
14 // LockWindowState implements Ash behavior without state machine. | |
15 class LockWindowState : public wm::WindowState::State { | |
16 public: | |
17 // The |window|'s state object will be modified to use this new window mode | |
18 // state handler. | |
19 explicit LockWindowState(aura::Window* window); | |
20 virtual ~LockWindowState(); | |
21 | |
22 // WindowState::State overrides: | |
23 virtual void OnWMEvent(wm::WindowState* window_state, | |
24 const wm::WMEvent* event) OVERRIDE; | |
25 | |
26 virtual wm::WindowStateType GetType() const OVERRIDE; | |
27 virtual void AttachState(wm::WindowState* window_state, | |
28 wm::WindowState::State* previous_state) OVERRIDE; | |
29 virtual void DetachState(wm::WindowState* window_state) OVERRIDE; | |
30 | |
31 private: | |
32 // Updates the window to |new_state_type| and resulting bounds: | |
33 // Either full screen, maximized centered or minimized. If the state does not | |
34 // change, only the bounds will be changed. | |
35 void UpdateWindow(wm::WindowState* window_state, | |
36 wm::WindowStateType new_state_type); | |
37 | |
38 // Depending on the capabilities of the window we either return | |
39 // |WINDOW_STATE_TYPE_MAXIMIZED| or |WINDOW_STATE_TYPE_NORMAL|. | |
40 wm::WindowStateType GetMaximizedOrCenteredWindowType( | |
41 wm::WindowState* window_state); | |
42 | |
43 // Updates the bounds taking virtual keyboard bounds into consideration. | |
44 void UpdateBounds(wm::WindowState* window_state); | |
45 | |
46 // The state object for this object which owns this instance. | |
47 aura::Window* window_; | |
oshima
2014/06/04 19:20:14
I believe you don't need this (you can always get
Nikita (slow)
2014/06/05 10:51:37
Done.
| |
48 | |
49 // The current state type. Due to the nature of this state, this can only be | |
50 // WM_STATE_TYPE{NORMAL, MINIMIZED, MAXIMIZED}. | |
51 wm::WindowStateType current_state_type_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(LockWindowState); | |
54 }; | |
55 | |
56 } // namespace ash | |
57 | |
58 #endif // ASH_WM_LOCK_WINDOW_STATE_H_ | |
OLD | NEW |