event_disabler.h 829 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright (c) 2016 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_UI_X_EVENT_DISABLER_H_
  5. #define ATOM_BROWSER_UI_X_EVENT_DISABLER_H_
  6. #include "base/macros.h"
  7. #include "ui/events/event_rewriter.h"
  8. namespace atom {
  9. class EventDisabler : public ui::EventRewriter {
  10. public:
  11. EventDisabler();
  12. ~EventDisabler() override;
  13. // ui::EventRewriter:
  14. ui::EventRewriteStatus RewriteEvent(
  15. const ui::Event& event,
  16. std::unique_ptr<ui::Event>* rewritten_event) override;
  17. ui::EventRewriteStatus NextDispatchEvent(
  18. const ui::Event& last_event,
  19. std::unique_ptr<ui::Event>* new_event) override;
  20. private:
  21. DISALLOW_COPY_AND_ASSIGN(EventDisabler);
  22. };
  23. } // namespace atom
  24. #endif // ATOM_BROWSER_UI_X_EVENT_DISABLER_H_