default_window_resizer.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Copyright (c) 2012 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. #ifndef ASH_WM_DEFAULT_WINDOW_RESIZER_H_
  5. #define ASH_WM_DEFAULT_WINDOW_RESIZER_H_
  6. #include <memory>
  7. #include "ash/ash_export.h"
  8. #include "ash/wm/window_resizer.h"
  9. namespace ash {
  10. // WindowResizer is used by ToplevelWindowEventFilter to handle dragging, moving
  11. // or resizing a window. All coordinates passed to this are in the parent
  12. // windows coordiantes.
  13. class ASH_EXPORT DefaultWindowResizer : public WindowResizer {
  14. public:
  15. ~DefaultWindowResizer() override;
  16. // Creates a new DefaultWindowResizer.
  17. static std::unique_ptr<DefaultWindowResizer> Create(
  18. WindowState* window_state);
  19. // WindowResizer:
  20. void Drag(const gfx::PointF& location, int event_flags) override;
  21. void CompleteDrag() override;
  22. void RevertDrag() override;
  23. void FlingOrSwipe(ui::GestureEvent* event) override;
  24. private:
  25. explicit DefaultWindowResizer(WindowState* window_state);
  26. DefaultWindowResizer(const DefaultWindowResizer&) = delete;
  27. DefaultWindowResizer& operator=(const DefaultWindowResizer&) = delete;
  28. // Set to true once Drag() is invoked and the bounds of the window change.
  29. bool did_move_or_resize_ = false;
  30. };
  31. } // namespace ash
  32. #endif // ASH_WM_DEFAULT_WINDOW_RESIZER_H_