Update V8 to version 4.7.16.
[chromium-blink-merge.git] / ui / events / test / test_event_targeter.h
blobee2502c417731ef9613193bb1cfe8bc4b42015a0
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.
5 #ifndef UI_EVENTS_TEST_TEST_EVENT_TARGETER_H_
6 #define UI_EVENTS_TEST_TEST_EVENT_TARGETER_H_
8 #include "base/compiler_specific.h"
9 #include "base/macros.h"
10 #include "ui/events/event_targeter.h"
12 namespace ui {
13 namespace test {
15 class TestEventTarget;
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;
27 void set_target(TestEventTarget* target);
29 private:
30 // EventTargeter:
31 EventTarget* FindTargetForEvent(EventTarget* root, Event* event) override;
32 EventTarget* FindNextBestTarget(EventTarget* previous_target,
33 Event* event) override;
35 TestEventTarget* target_;
36 bool should_bubble_;
38 DISALLOW_COPY_AND_ASSIGN(TestEventTargeter);
41 } // namespace test
42 } // namespace ui
44 #endif // UI_EVENTS_TEST_TEST_EVENT_TARGETER_H_