| 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_DEFAULT_STATE_H_ | 5 #ifndef ASH_WM_DEFAULT_STATE_H_ |
| 6 #define ASH_WM_DEFAULT_STATE_H_ | 6 #define ASH_WM_DEFAULT_STATE_H_ |
| 7 | 7 |
| 8 #include "ash/wm/window_state.h" | 8 #include "ash/wm/window_state.h" |
| 9 #include "ui/gfx/display.h" | 9 #include "ui/gfx/display.h" |
| 10 | 10 |
| 11 namespace ash { | 11 namespace ash { |
| 12 namespace wm { | 12 namespace wm { |
| 13 class SetBoundsEvent; | 13 class SetBoundsEvent; |
| 14 | 14 |
| 15 // DefaultState implements Ash behavior without state machine. | 15 // DefaultState implements Ash behavior without state machine. |
| 16 class DefaultState : public WindowState::State { | 16 class DefaultState : public WindowState::State { |
| 17 public: | 17 public: |
| 18 explicit DefaultState(WindowStateType initial_state_type); | 18 explicit DefaultState(WindowStateType initial_state_type); |
| 19 virtual ~DefaultState(); | 19 virtual ~DefaultState(); |
| 20 | 20 |
| 21 // WindowState::State overrides: | 21 // WindowState::State overrides: |
| 22 virtual void OnWMEvent(WindowState* window_state, | 22 virtual void OnWMEvent(WindowState* window_state, |
| 23 const WMEvent* event) OVERRIDE; | 23 const WMEvent* event) override; |
| 24 virtual WindowStateType GetType() const OVERRIDE; | 24 virtual WindowStateType GetType() const override; |
| 25 virtual void AttachState(WindowState* window_state, | 25 virtual void AttachState(WindowState* window_state, |
| 26 WindowState::State* previous_state) OVERRIDE; | 26 WindowState::State* previous_state) override; |
| 27 virtual void DetachState(WindowState* window_state) OVERRIDE; | 27 virtual void DetachState(WindowState* window_state) override; |
| 28 | 28 |
| 29 private: | 29 private: |
| 30 // Process state dependent events, such as TOGGLE_MAXIMIZED, | 30 // Process state dependent events, such as TOGGLE_MAXIMIZED, |
| 31 // TOGGLE_FULLSCREEN. | 31 // TOGGLE_FULLSCREEN. |
| 32 static bool ProcessCompoundEvents(WindowState* window_state, | 32 static bool ProcessCompoundEvents(WindowState* window_state, |
| 33 const WMEvent* event); | 33 const WMEvent* event); |
| 34 | 34 |
| 35 // Process workspace related events, such as DISPLAY_BOUNDS_CHANGED. | 35 // Process workspace related events, such as DISPLAY_BOUNDS_CHANGED. |
| 36 static bool ProcessWorkspaceEvents(WindowState* window_state, | 36 static bool ProcessWorkspaceEvents(WindowState* window_state, |
| 37 const WMEvent* event); | 37 const WMEvent* event); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // The window state only gets remembered for DCHECK reasons. | 72 // The window state only gets remembered for DCHECK reasons. |
| 73 WindowState* stored_window_state_; | 73 WindowState* stored_window_state_; |
| 74 | 74 |
| 75 DISALLOW_COPY_AND_ASSIGN(DefaultState); | 75 DISALLOW_COPY_AND_ASSIGN(DefaultState); |
| 76 }; | 76 }; |
| 77 | 77 |
| 78 } // namespace wm | 78 } // namespace wm |
| 79 } // namespace ash | 79 } // namespace ash |
| 80 | 80 |
| 81 #endif // ASH_WM_DEFAULT_STATE_H_ | 81 #endif // ASH_WM_DEFAULT_STATE_H_ |
| OLD | NEW |