#ifndef ASH_WM_DEFAULT_STATE_H_
#define ASH_WM_DEFAULT_STATE_H_
#include "ash/wm/base_state.h"
#include "ash/wm/window_state.h"
#include "base/memory/raw_ptr.h"
#include "chromeos/ui/frame/multitask_menu/float_controller_base.h"
#include "ui/display/display.h"
#include "ui/gfx/geometry/rect.h"
namespace ash {
class SetBoundsWMEvent;
class DefaultState : public BaseState {
public:
explicit DefaultState(chromeos::WindowStateType initial_state_type);
DefaultState(const DefaultState&) = delete;
DefaultState& operator=(const DefaultState&) = delete;
~DefaultState() override;
void AttachState(WindowState* window_state,
WindowState::State* previous_state) override;
void DetachState(WindowState* window_state) override;
void HandleWorkspaceEvents(WindowState* window_state,
const WMEvent* event) override;
void HandleCompoundEvents(WindowState* window_state,
const WMEvent* event) override;
void HandleBoundsEvents(WindowState* window_state,
const WMEvent* event) override;
void HandleTransitionEvents(WindowState* window_state,
const WMEvent* event) override;
private:
bool SetMaximizedOrFullscreenBounds(WindowState* window_state);
void SetBounds(WindowState* window_state,
const SetBoundsWMEvent* bounds_event);
void EnterToNextState(
WindowState* window_state,
chromeos::WindowStateType next_state_type,
std::optional<chromeos::FloatStartLocation> float_start_location);
void ReenterToCurrentState(WindowState* window_state,
WindowState::State* state_in_previous_mode);
void UpdateBoundsFromState(
WindowState* window_state,
chromeos::WindowStateType old_state_type,
std::optional<chromeos::FloatStartLocation> float_start_location);
void UpdateBoundsForDisplayOrWorkAreaBoundsChange(
WindowState* window_state,
bool ensure_full_window_visibility);
gfx::Rect stored_bounds_;
gfx::Rect stored_restore_bounds_;
display::Display stored_display_state_;
raw_ptr<WindowState> stored_window_state_ = nullptr;
};
}
#endif