MD Downloads: prevent search text from overlapping with the cancel search (X)
[chromium-blink-merge.git] / ui / aura / test / event_generator_delegate_aura.h
blob7cc7f2f9cf949f2c91d872e2836749117f8a64b6
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.
5 #ifndef UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_
6 #define UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_
8 #include "ui/events/test/event_generator.h"
10 namespace aura {
11 class Window;
12 class WindowTreeHost;
14 namespace client {
15 class ScreenPositionClient;
18 namespace test {
20 void InitializeAuraEventGeneratorDelegate();
22 // Implementation of ui::test::EventGeneratorDelegate for Aura.
23 class EventGeneratorDelegateAura : public ui::test::EventGeneratorDelegate {
24 public:
25 EventGeneratorDelegateAura();
26 ~EventGeneratorDelegateAura() override;
28 // Returns the host for given point.
29 virtual WindowTreeHost* GetHostAt(const gfx::Point& point) const = 0;
31 // Returns the screen position client that determines the
32 // coordinates used in EventGenerator. EventGenerator uses
33 // root Window's coordinate if this returns NULL.
34 virtual client::ScreenPositionClient* GetScreenPositionClient(
35 const aura::Window* window) const = 0;
37 // Overridden from ui::test::EventGeneratorDelegate:
38 ui::EventTarget* GetTargetAt(const gfx::Point& location) override;
39 ui::EventSource* GetEventSource(ui::EventTarget* target) override;
40 gfx::Point CenterOfTarget(const ui::EventTarget* target) const override;
41 gfx::Point CenterOfWindow(gfx::NativeWindow window) const override;
42 void ConvertPointFromTarget(const ui::EventTarget* target,
43 gfx::Point* point) const override;
44 void ConvertPointToTarget(const ui::EventTarget* target,
45 gfx::Point* point) const override;
46 void ConvertPointFromHost(const ui::EventTarget* hosted_target,
47 gfx::Point* point) const override;
49 private:
50 DISALLOW_COPY_AND_ASSIGN(EventGeneratorDelegateAura);
53 } // namespace test
54 } // namespace aura
56 #endif // UI_AURA_TEST_EVENT_GENERATOR_DELEGATE_AURA_H_