Chromium Code Reviews| 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_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 Loading... | |
| 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, RELEASE = 1 << 2, MOVE = 1 << 3 }; | |
|
sky
2017/06/22 20:54:22
Use enum class.
lanwei
2017/06/23 20:06:05
I need to use bit-wise operator, &, |, so I cannot
| |
| 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 bool SendTouchEvents(int action, int num, int x, int y); | |
|
sky
2017/06/22 20:54:22
Document what action and num is.
lanwei
2017/06/23 20:06:05
Done.
| |
| 97 | |
| 98 bool SendTouchEventsNotifyWhenDone(int action, | |
| 99 int num, | |
| 100 int x, | |
| 101 int y, | |
| 102 const base::Closure& task); | |
|
sky
2017/06/22 20:54:22
There is no point in this variant given you can no
lanwei
2017/06/23 20:06:05
I removed the function SendTouchEvents, I need a t
sky
2017/06/24 00:01:14
Why do you need a task? The reason the other varia
lanwei
2017/06/26 22:59:28
Acknowledged.
| |
| 103 | |
| 94 #if defined(TOOLKIT_VIEWS) | 104 #if defined(TOOLKIT_VIEWS) |
| 95 // Runs |closure| after processing all pending ui events. | 105 // Runs |closure| after processing all pending ui events. |
| 96 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure); | 106 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure); |
| 97 #endif | 107 #endif |
| 98 | 108 |
| 99 #if defined(USE_AURA) | 109 #if defined(USE_AURA) |
| 100 class UIControlsAura; | 110 class UIControlsAura; |
| 101 void InstallUIControlsAura(UIControlsAura* instance); | 111 void InstallUIControlsAura(UIControlsAura* instance); |
| 102 #endif | 112 #endif |
| 103 | 113 |
| 104 #if defined(OS_MACOSX) | 114 #if defined(OS_MACOSX) |
| 105 // Returns true when tests need to use extra Tab and Shift-Tab key events | 115 // 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 | 116 // to traverse to the desired item; because the application is configured to |
| 107 // traverse more elements for accessibility reasons. | 117 // traverse more elements for accessibility reasons. |
| 108 bool IsFullKeyboardAccessEnabled(); | 118 bool IsFullKeyboardAccessEnabled(); |
| 109 #endif | 119 #endif |
| 110 | 120 |
| 111 } // namespace ui_controls | 121 } // namespace ui_controls |
| 112 | 122 |
| 113 #endif // UI_BASE_TEST_UI_CONTROLS_H_ | 123 #endif // UI_BASE_TEST_UI_CONTROLS_H_ |
| OLD | NEW |