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

Side by Side Diff: ui/events/test/test_event_targeter.h

Issue 1287103004: Sync ui/events to chromium @ https://codereview.chromium.org/1210203002 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: rebased Created 5 years, 4 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
« no previous file with comments | « ui/events/test/test_event_target.cc ('k') | ui/events/test/test_event_targeter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 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_TEST_TEST_EVENT_TARGETER_H_
6 #define UI_EVENTS_TEST_TEST_EVENT_TARGETER_H_
7
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "ui/events/event_targeter.h"
11
12 namespace ui {
13 namespace test {
14
15 class TestEventTarget;
16
17 // An EventTargeter which is used to allow a bubbling behaviour in event
18 // dispatch: if an event is not handled after being dispatched to its
19 // |initial_target|, the event is dispatched to the next-best target as
20 // specified by FindNextBestTarget().
21 // Bubbling behaviour is controlled by |should_bubble| at creation time.
22 class TestEventTargeter : public EventTargeter {
23 public:
24 TestEventTargeter(TestEventTarget* initial_target, bool should_bubble);
25 ~TestEventTargeter() override;
26
27 void set_target(TestEventTarget* target);
28
29 private:
30 // EventTargeter:
31 EventTarget* FindTargetForEvent(EventTarget* root, Event* event) override;
32 EventTarget* FindNextBestTarget(EventTarget* previous_target,
33 Event* event) override;
34
35 TestEventTarget* target_;
36 bool should_bubble_;
37
38 DISALLOW_COPY_AND_ASSIGN(TestEventTargeter);
39 };
40
41 } // namespace test
42 } // namespace ui
43
44 #endif // UI_EVENTS_TEST_TEST_EVENT_TARGETER_H_
OLDNEW
« no previous file with comments | « ui/events/test/test_event_target.cc ('k') | ui/events/test/test_event_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698