autoclick_drag_event_rewriter.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_ACCESSIBILITY_AUTOCLICK_AUTOCLICK_DRAG_EVENT_REWRITER_H_
  5. #define ASH_ACCESSIBILITY_AUTOCLICK_AUTOCLICK_DRAG_EVENT_REWRITER_H_
  6. #include "ash/ash_export.h"
  7. #include "ui/events/event_rewriter.h"
  8. namespace ash {
  9. // EventRewriter to change move events into drag events during drag-and-drop
  10. // actions from Autoclick.
  11. class ASH_EXPORT AutoclickDragEventRewriter : public ui::EventRewriter {
  12. public:
  13. AutoclickDragEventRewriter() = default;
  14. AutoclickDragEventRewriter(const AutoclickDragEventRewriter&) = delete;
  15. AutoclickDragEventRewriter& operator=(const AutoclickDragEventRewriter&) =
  16. delete;
  17. ~AutoclickDragEventRewriter() override = default;
  18. void SetEnabled(bool enabled);
  19. bool IsEnabled() const;
  20. // ui::EventRewriter (visible for testing):
  21. ui::EventDispatchDetails RewriteEvent(
  22. const ui::Event& event,
  23. const Continuation continuation) override;
  24. private:
  25. bool enabled_ = false;
  26. };
  27. } // namespace ash
  28. #endif // ASH_ACCESSIBILITY_AUTOCLICK_AUTOCLICK_DRAG_EVENT_REWRITER_H_