Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: ash/common/wm/default_state.h

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/common/wm/container_finder_unittest.cc ('k') | ash/common/wm/default_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_COMMON_WM_DEFAULT_STATE_H_
6 #define ASH_COMMON_WM_DEFAULT_STATE_H_
7
8 #include "ash/common/wm/window_state.h"
9 #include "base/macros.h"
10 #include "ui/display/display.h"
11 #include "ui/gfx/geometry/rect.h"
12
13 namespace ash {
14 namespace wm {
15 class SetBoundsEvent;
16
17 // DefaultState implements Ash behavior without state machine.
18 class DefaultState : public WindowState::State {
19 public:
20 explicit DefaultState(WindowStateType initial_state_type);
21 ~DefaultState() override;
22
23 // WindowState::State overrides:
24 void OnWMEvent(WindowState* window_state, const WMEvent* event) override;
25 WindowStateType GetType() const override;
26 void AttachState(WindowState* window_state,
27 WindowState::State* previous_state) override;
28 void DetachState(WindowState* window_state) override;
29
30 private:
31 // Process state dependent events, such as TOGGLE_MAXIMIZED,
32 // TOGGLE_FULLSCREEN.
33 static bool ProcessCompoundEvents(WindowState* window_state,
34 const WMEvent* event);
35
36 // Process workspace related events, such as DISPLAY_BOUNDS_CHANGED.
37 static bool ProcessWorkspaceEvents(WindowState* window_state,
38 const WMEvent* event);
39
40 // Set the fullscreen/maximized bounds without animation.
41 static bool SetMaximizedOrFullscreenBounds(wm::WindowState* window_state);
42
43 static void SetBounds(WindowState* window_state,
44 const SetBoundsEvent* bounds_event);
45
46 static void CenterWindow(WindowState* window_state);
47
48 // Enters next state. This is used when the state moves from one to another
49 // within the same desktop mode.
50 void EnterToNextState(wm::WindowState* window_state,
51 wm::WindowStateType next_state_type);
52
53 // Reenters the current state. This is called when migrating from
54 // previous desktop mode, and the window's state needs to re-construct the
55 // state/bounds for this state.
56 void ReenterToCurrentState(wm::WindowState* window_state,
57 wm::WindowState::State* state_in_previous_mode);
58
59 // Animates to new window bounds based on the current and previous state type.
60 void UpdateBoundsFromState(wm::WindowState* window_state,
61 wm::WindowStateType old_state_type);
62
63 // The current type of the window.
64 WindowStateType state_type_;
65
66 // The saved window state for the case that the state gets de-/activated.
67 gfx::Rect stored_bounds_;
68 gfx::Rect stored_restore_bounds_;
69
70 // The display state in which the mode got started.
71 display::Display stored_display_state_;
72
73 // The window state only gets remembered for DCHECK reasons.
74 WindowState* stored_window_state_;
75
76 DISALLOW_COPY_AND_ASSIGN(DefaultState);
77 };
78
79 } // namespace wm
80 } // namespace ash
81
82 #endif // ASH_COMMON_WM_DEFAULT_STATE_H_
OLDNEW
« no previous file with comments | « ash/common/wm/container_finder_unittest.cc ('k') | ash/common/wm/default_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698