Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 explicit TestEventTargeter(TestEventTarget* initial_target, | |
|
tdanderson
2015/05/25 15:00:08
nit: not explicit since ctor has two parameters.
varkha
2015/05/25 15:53:31
Done.
| |
| 25 bool should_bubble); | |
| 26 ~TestEventTargeter() override; | |
| 27 | |
| 28 void set_initial_target(TestEventTarget* initial_target); | |
| 29 | |
| 30 private: | |
| 31 // EventTargeter: | |
| 32 EventTarget* FindTargetForEvent(EventTarget* root, Event* event) override; | |
| 33 | |
|
tdanderson
2015/05/25 15:00:08
nit: remove newline
varkha
2015/05/25 15:53:31
Done.
| |
| 34 EventTarget* FindNextBestTarget(EventTarget* previous_target, | |
| 35 Event* event) override; | |
| 36 | |
| 37 TestEventTarget* initial_target_; | |
| 38 bool should_bubble_; | |
| 39 | |
| 40 DISALLOW_COPY_AND_ASSIGN(TestEventTargeter); | |
| 41 }; | |
| 42 | |
| 43 } // namespace test | |
| 44 } // namespace ui | |
| 45 | |
| 46 #endif // UI_EVENTS_TEST_TEST_EVENT_TARGETER_H_ | |
| OLD | NEW |