Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(764)

Side by Side Diff: ui/events/event_rewriter.h

Issue 210203002: events: Introduce EventRewriter. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 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
5 #ifndef UI_EVENTS_EVENT_REWRITER_H_
6 #define UI_EVENTS_EVENT_REWRITER_H_
7
8 #include "ui/events/events_export.h"
9
10 namespace ui {
11
12 class Event;
13
14 enum EventRewriteStatus {
15 EVENT_REWRITE_CONTINUE,
16 EVENT_REWRITE_REWRITTEN,
17 EVENT_REWRITE_DISCARD,
18 EVENT_REWRITE_DISPATCH_ANOTHER,
sadrul 2014/03/24 21:15:38 Comments for each to explain what they mean.
19 };
20
21 class EVENTS_EXPORT EventRewriter {
sadrul 2014/03/24 21:15:38 A brief class-level comment to give an overview of
22 public:
23 virtual ~EventRewriter() {}
24
25 // If the rewriter wants to rewrite an event, and dispatch
26 // another event once the rewritten event is dispatched, it
27 // should return EVENT_REWRITE_DISPATCH_ANOTHER, and return
28 // the next event to dispatch from |NextDispatchEvent()|.
29 virtual EventRewriteStatus RewriteEvent(const Event& event,
30 Event** rewritten_event) = 0;
31
32 virtual EventRewriteStatus NextDispatchEvent(const Event& last_event,
33 Event** new_event) = 0;
34 };
35
36 } // namespace ui
37
38 #endif // UI_EVENTS_EVENT_REWRITER_H_
OLDNEW
« no previous file with comments | « no previous file | ui/events/event_rewriter_unittest.cc » ('j') | ui/events/event_rewriter_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698