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

Side by Side Diff: components/test_runner/event_sender.h

Issue 1855513002: Consider isPrimary and pointerType when preventing compat mouse (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a test Created 4 years, 8 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
OLDNEW
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 #ifndef COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 5 #ifndef COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
6 #define COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 6 #define COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map>
10 #include <queue> 11 #include <queue>
11 #include <string> 12 #include <string>
12 #include <vector> 13 #include <vector>
13 14
14 #include "base/macros.h" 15 #include "base/macros.h"
15 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
16 #include "base/memory/weak_ptr.h" 17 #include "base/memory/weak_ptr.h"
17 #include "build/build_config.h" 18 #include "build/build_config.h"
18 #include "components/test_runner/web_task.h" 19 #include "components/test_runner/web_task.h"
19 #include "third_party/WebKit/public/platform/WebDragData.h" 20 #include "third_party/WebKit/public/platform/WebDragData.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 55
55 void Reset(); 56 void Reset();
56 void Install(blink::WebFrame*); 57 void Install(blink::WebFrame*);
57 void SetDelegate(WebTestDelegate*); 58 void SetDelegate(WebTestDelegate*);
58 void SetWebView(blink::WebView*); 59 void SetWebView(blink::WebView*);
59 60
60 void SetContextMenuData(const blink::WebContextMenuData&); 61 void SetContextMenuData(const blink::WebContextMenuData&);
61 62
62 void DoDragDrop(const blink::WebDragData&, blink::WebDragOperationsMask); 63 void DoDragDrop(const blink::WebDragData&, blink::WebDragOperationsMask);
63 64
64 void MouseDown(int button_number, int modifiers); 65 void MouseDown(int button_number, int modifiers,
65 void MouseUp(int button_number, int modifiers); 66 blink::WebPointerProperties::PointerType =
67 blink::WebPointerProperties::PointerType::Mouse,
68 int pointerId = 0);
69 void MouseUp(int button_number, int modifiers,
70 blink::WebPointerProperties::PointerType =
71 blink::WebPointerProperties::PointerType::Mouse,
72 int pointerId = 0);
66 void SetMouseButtonState(int button_number, int modifiers); 73 void SetMouseButtonState(int button_number, int modifiers);
67 74
68 void KeyDown(const std::string& code_str, 75 void KeyDown(const std::string& code_str,
69 int modifiers, 76 int modifiers,
70 KeyLocationCode location); 77 KeyLocationCode location);
71 78
72 WebTaskList* mutable_task_list() { return &task_list_; } 79 WebTaskList* mutable_task_list() { return &task_list_; }
73 80
74 void set_send_wheel_gestures(bool send_wheel_gestures) { 81 void set_send_wheel_gestures(bool send_wheel_gestures) {
75 send_wheel_gestures_ = send_wheel_gestures; 82 send_wheel_gestures_ = send_wheel_gestures;
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 bool touch_cancelable_; 267 bool touch_cancelable_;
261 std::vector<blink::WebTouchPoint> touch_points_; 268 std::vector<blink::WebTouchPoint> touch_points_;
262 269
263 scoped_ptr<blink::WebContextMenuData> last_context_menu_data_; 270 scoped_ptr<blink::WebContextMenuData> last_context_menu_data_;
264 271
265 blink::WebDragData current_drag_data_; 272 blink::WebDragData current_drag_data_;
266 273
267 // Location of the touch point that initiated a gesture. 274 // Location of the touch point that initiated a gesture.
268 blink::WebPoint current_gesture_location_; 275 blink::WebPoint current_gesture_location_;
269 276
277
278 // Pen pointer properties
279 typedef struct PenProperties {
dtapuska 2016/04/05 19:21:25 I don't think we need to define structs in c-style
Navid Zolghadr 2016/04/05 20:17:25 Done.
280 blink::WebMouseEvent::Button pressed_button_;
281 int current_buttons_;
282 int modifiers_;
283 blink::WebPoint last_pos_;
284 PenProperties()
285 : pressed_button_(blink::WebMouseEvent::ButtonNone)
286 , current_buttons_(0)
287 , modifiers_(0)
288 , last_pos_(blink::WebPoint(0, 0)) { }
289 } PenProperties;
290 std::map<int, PenProperties> stateOfPen;
dtapuska 2016/04/05 19:21:25 Add a typedef for this map. Can this be an unorder
Navid Zolghadr 2016/04/05 20:17:25 Done.
291
270 // Last pressed mouse button (Left/Right/Middle or None). 292 // Last pressed mouse button (Left/Right/Middle or None).
271 static blink::WebMouseEvent::Button pressed_button_; 293 static blink::WebMouseEvent::Button pressed_button_;
272 294
273 // A bitwise OR of the WebMouseEvent::*ButtonDown values corresponding to 295 // A bitwise OR of the WebMouseEvent::*ButtonDown values corresponding to
274 // currently pressed buttons of mouse. 296 // currently pressed buttons of mouse.
275 static int current_buttons_; 297 static int current_buttons_;
276 298
277 static int modifiers_; 299 static int modifiers_;
278 300
279 bool replaying_saved_events_; 301 bool replaying_saved_events_;
(...skipping 21 matching lines...) Expand all
301 double last_event_timestamp_; 323 double last_event_timestamp_;
302 324
303 base::WeakPtrFactory<EventSender> weak_factory_; 325 base::WeakPtrFactory<EventSender> weak_factory_;
304 326
305 DISALLOW_COPY_AND_ASSIGN(EventSender); 327 DISALLOW_COPY_AND_ASSIGN(EventSender);
306 }; 328 };
307 329
308 } // namespace test_runner 330 } // namespace test_runner
309 331
310 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_ 332 #endif // COMPONENTS_TEST_RUNNER_EVENT_SENDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/test_runner/event_sender.cc » ('j') | components/test_runner/event_sender.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698