Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Side by Side Diff: ui/base/test/ui_controls.h

Issue 2904113002: Replacing WM_TOUCH with WM_POINTER for touch events on Wins 8+ (Closed)
Patch Set: wm touch Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/test/ui_controls_factory_aurawin.cc ('k') | ui/base/test/ui_controls_aura.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_BASE_TEST_UI_CONTROLS_H_ 5 #ifndef UI_BASE_TEST_UI_CONTROLS_H_
6 #define UI_BASE_TEST_UI_CONTROLS_H_ 6 #define UI_BASE_TEST_UI_CONTROLS_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "ui/events/keycodes/keyboard_codes.h" 10 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 MIDDLE, 73 MIDDLE,
74 RIGHT, 74 RIGHT,
75 }; 75 };
76 76
77 // Used to indicate the state of the button when generating events. 77 // Used to indicate the state of the button when generating events.
78 enum MouseButtonState { 78 enum MouseButtonState {
79 UP = 1, 79 UP = 1,
80 DOWN = 2 80 DOWN = 2
81 }; 81 };
82 82
83 enum TouchType { PRESS = 1 << 0, RELEASE = 1 << 1, MOVE = 1 << 2 };
84
83 // Sends a mouse down and/or up message. The click will be sent to wherever 85 // Sends a mouse down and/or up message. The click will be sent to wherever
84 // the cursor currently is, so be sure to move the cursor before calling this 86 // the cursor currently is, so be sure to move the cursor before calling this
85 // (and be sure the cursor has arrived!). 87 // (and be sure the cursor has arrived!).
86 bool SendMouseEvents(MouseButton type, int state); 88 bool SendMouseEvents(MouseButton type, int state);
87 bool SendMouseEventsNotifyWhenDone(MouseButton type, 89 bool SendMouseEventsNotifyWhenDone(MouseButton type,
88 int state, 90 int state,
89 const base::Closure& task); 91 const base::Closure& task);
90 92
91 // Same as SendMouseEvents with UP | DOWN. 93 // Same as SendMouseEvents with UP | DOWN.
92 bool SendMouseClick(MouseButton type); 94 bool SendMouseClick(MouseButton type);
93 95
96 #if defined(OS_WIN)
97 // Send WM_POINTER messages to generate touch events. There is no way to detect
98 // when events are received by chrome, it's up to users of this API to detect
99 // when events arrive. |action| is a bitmask of the TouchType constants that
100 // indicate what events are generated, |num| is the number of the touch
101 // pointers, |screen_x| and |screen_y| are the screen coordinates of a touch
102 // pointer.
103 bool SendTouchEvents(int action, int num, int screen_x, int screen_y);
104 #endif
105
94 #if defined(TOOLKIT_VIEWS) 106 #if defined(TOOLKIT_VIEWS)
95 // Runs |closure| after processing all pending ui events. 107 // Runs |closure| after processing all pending ui events.
96 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure); 108 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure);
97 #endif 109 #endif
98 110
99 #if defined(USE_AURA) 111 #if defined(USE_AURA)
100 class UIControlsAura; 112 class UIControlsAura;
101 void InstallUIControlsAura(UIControlsAura* instance); 113 void InstallUIControlsAura(UIControlsAura* instance);
102 #endif 114 #endif
103 115
104 #if defined(OS_MACOSX) 116 #if defined(OS_MACOSX)
105 // Returns true when tests need to use extra Tab and Shift-Tab key events 117 // Returns true when tests need to use extra Tab and Shift-Tab key events
106 // to traverse to the desired item; because the application is configured to 118 // to traverse to the desired item; because the application is configured to
107 // traverse more elements for accessibility reasons. 119 // traverse more elements for accessibility reasons.
108 bool IsFullKeyboardAccessEnabled(); 120 bool IsFullKeyboardAccessEnabled();
109 #endif 121 #endif
110 122
111 } // namespace ui_controls 123 } // namespace ui_controls
112 124
113 #endif // UI_BASE_TEST_UI_CONTROLS_H_ 125 #endif // UI_BASE_TEST_UI_CONTROLS_H_
OLDNEW
« no previous file with comments | « ui/aura/test/ui_controls_factory_aurawin.cc ('k') | ui/base/test/ui_controls_aura.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698