OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/aura/test/event_generator_delegate_aura.h" | 5 #include "ui/aura/test/event_generator_delegate_aura.h" |
6 | 6 |
7 #include "base/memory/singleton.h" | 7 #include "base/memory/singleton.h" |
8 #include "ui/aura/client/screen_position_client.h" | 8 #include "ui/aura/client/screen_position_client.h" |
9 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
10 #include "ui/aura/window_tree_host.h" | 10 #include "ui/aura/window_tree_host.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 EventGeneratorDelegateAura::EventGeneratorDelegateAura() { | 67 EventGeneratorDelegateAura::EventGeneratorDelegateAura() { |
68 } | 68 } |
69 | 69 |
70 EventGeneratorDelegateAura::~EventGeneratorDelegateAura() { | 70 EventGeneratorDelegateAura::~EventGeneratorDelegateAura() { |
71 } | 71 } |
72 | 72 |
73 ui::EventTarget* EventGeneratorDelegateAura::GetTargetAt( | 73 ui::EventTarget* EventGeneratorDelegateAura::GetTargetAt( |
74 const gfx::Point& location) { | 74 const gfx::Point& location) { |
| 75 // TODO(andresantoso): Add support for EventGenerator::targeting_application() |
| 76 // if needed for Ash. |
75 return GetHostAt(location)->window(); | 77 return GetHostAt(location)->window(); |
76 } | 78 } |
77 | 79 |
78 ui::EventSource* EventGeneratorDelegateAura::GetEventSource( | 80 ui::EventSource* EventGeneratorDelegateAura::GetEventSource( |
79 ui::EventTarget* target) { | 81 ui::EventTarget* target) { |
80 return static_cast<Window*>(target)->GetHost()->GetEventSource(); | 82 return static_cast<Window*>(target)->GetHost()->GetEventSource(); |
81 } | 83 } |
82 | 84 |
83 gfx::Point EventGeneratorDelegateAura::CenterOfTarget( | 85 gfx::Point EventGeneratorDelegateAura::CenterOfTarget( |
84 const ui::EventTarget* target) const { | 86 const ui::EventTarget* target) const { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 121 |
120 void EventGeneratorDelegateAura::ConvertPointFromHost( | 122 void EventGeneratorDelegateAura::ConvertPointFromHost( |
121 const ui::EventTarget* hosted_target, | 123 const ui::EventTarget* hosted_target, |
122 gfx::Point* point) const { | 124 gfx::Point* point) const { |
123 const Window* window = WindowFromTarget(hosted_target); | 125 const Window* window = WindowFromTarget(hosted_target); |
124 window->GetHost()->ConvertPointFromHost(point); | 126 window->GetHost()->ConvertPointFromHost(point); |
125 } | 127 } |
126 | 128 |
127 } // namespace test | 129 } // namespace test |
128 } // namespace aura | 130 } // namespace aura |
OLD | NEW |