OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef UI_VIEWS_EVENT_UTILS_H_ | 5 #ifndef UI_VIEWS_EVENT_UTILS_H_ |
6 #define UI_VIEWS_EVENT_UTILS_H_ | 6 #define UI_VIEWS_EVENT_UTILS_H_ |
7 | 7 |
8 #include "ui/gfx/native_widget_types.h" | 8 #include "ui/gfx/native_widget_types.h" |
9 #include "ui/views/views_export.h" | 9 #include "ui/views/views_export.h" |
10 | 10 |
11 namespace ui { | 11 namespace ui { |
12 class LocatedEvent; | 12 class LocatedEvent; |
13 } | 13 } |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 | 16 |
17 // Reposts a located event natively. Returns false when |event| could not be | 17 // Reposts a located event natively. Returns false when |event| could not be |
18 // reposted. |event| should be in screen coordinates. |window| is the target | 18 // reposted. |event| should be in screen coordinates. |window| is the target |
19 // window that the event will be forwarded to. Only some events are supported. | 19 // window that the event will be forwarded to. Only some events are supported. |
| 20 // On Windows |window| can be NULL, in which case the event is forwarded to |
| 21 // the HWND at the current location if it is on the same thread. |
20 VIEWS_EXPORT bool RepostLocatedEvent(gfx::NativeWindow window, | 22 VIEWS_EXPORT bool RepostLocatedEvent(gfx::NativeWindow window, |
21 const ui::LocatedEvent& event); | 23 const ui::LocatedEvent& event); |
22 | 24 |
23 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
24 // Reposts a located event to the HWND passed in. | 26 // Reposts a located event to the HWND passed in. |
25 VIEWS_EXPORT bool RepostLocatedEventWin(HWND window, | 27 VIEWS_EXPORT bool RepostLocatedEventWin(HWND window, |
26 const ui::LocatedEvent& event); | 28 const ui::LocatedEvent& event); |
27 #endif | 29 #endif |
28 | 30 |
29 } // namespace views | 31 } // namespace views |
30 | 32 |
31 #endif // UI_VIEWS_EVENT_UTILS_H_ | 33 #endif // UI_VIEWS_EVENT_UTILS_H_ |
OLD | NEW |