#ifndef ASH_WM_PIP_PIP_WINDOW_RESIZER_H_
#define ASH_WM_PIP_PIP_WINDOW_RESIZER_H_
#include "ash/ash_export.h"
#include "ash/wm/window_resizer.h"
#include "ui/display/display.h"
#include "ui/gfx/geometry/point_f.h"
namespace gfx {
class Rect;
}
namespace ash {
class WindowState;
class ASH_EXPORT PipWindowResizer : public WindowResizer {
public:
explicit PipWindowResizer(WindowState* window_state);
PipWindowResizer(const PipWindowResizer&) = delete;
PipWindowResizer& operator=(const PipWindowResizer&) = delete;
~PipWindowResizer() override;
void Drag(const gfx::PointF& location_in_parent, int event_flags) override;
void Pinch(const gfx::PointF& location, float scale) override;
void CompleteDrag() override;
void RevertDrag() override;
void FlingOrSwipe(ui::GestureEvent* event) override;
private:
WindowState* window_state() { return window_state_; }
gfx::Rect CalculateBoundsForPinch(
const gfx::PointF& location_in_parent) const;
gfx::Rect ComputeFlungPosition();
std::optional<gfx::PointF> last_location_in_screen_;
bool last_event_was_pinch_ = false;
int fling_velocity_x_ = 0;
int fling_velocity_y_ = 0;
float in_screen_fraction_ = 1.f;
float accumulated_scale_ = 1.f;
bool moved_or_resized_ = false;
bool may_dismiss_horizontally_ = false;
bool may_dismiss_vertically_ = false;
};
}
#endif