snap_controller_impl.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2018 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_FRAME_SNAP_CONTROLLER_IMPL_H_
  5. #define ASH_FRAME_SNAP_CONTROLLER_IMPL_H_
  6. #include <memory>
  7. #include "ash/ash_export.h"
  8. #include "chromeos/ui/frame/caption_buttons/snap_controller.h"
  9. namespace ash {
  10. class PhantomWindowController;
  11. // A controller for toplevel window actions which can only run in Ash.
  12. class ASH_EXPORT SnapControllerImpl : public chromeos::SnapController {
  13. public:
  14. SnapControllerImpl();
  15. SnapControllerImpl(const SnapControllerImpl&) = delete;
  16. SnapControllerImpl& operator=(const SnapControllerImpl&) = delete;
  17. ~SnapControllerImpl() override;
  18. bool CanSnap(aura::Window* window) override;
  19. void ShowSnapPreview(aura::Window* window,
  20. chromeos::SnapDirection snap,
  21. bool allow_haptic_feedback) override;
  22. void CommitSnap(aura::Window* window,
  23. chromeos::SnapDirection snap,
  24. chromeos::SnapRatio snap_ratio) override;
  25. private:
  26. std::unique_ptr<PhantomWindowController> phantom_window_controller_;
  27. };
  28. } // namespace ash
  29. #endif // ASH_FRAME_SNAP_CONTROLLER_IMPL_H_