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

Side by Side Diff: content/browser/renderer_host/input/synthetic_touch_driver.h

Issue 2634183002: Support multi-button press for synthetic mouse events (Closed)
Patch Set: button Created 3 years, 11 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TOUCH_DRIVER_H_
7 7
8 #include <array> 8 #include <array>
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" 10 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/common/input/synthetic_web_input_event_builders.h" 12 #include "content/common/input/synthetic_web_input_event_builders.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class CONTENT_EXPORT SyntheticTouchDriver : public SyntheticPointerDriver { 16 class CONTENT_EXPORT SyntheticTouchDriver : public SyntheticPointerDriver {
17 public: 17 public:
18 SyntheticTouchDriver(); 18 SyntheticTouchDriver();
19 explicit SyntheticTouchDriver(SyntheticWebTouchEvent touch_event); 19 explicit SyntheticTouchDriver(SyntheticWebTouchEvent touch_event);
20 ~SyntheticTouchDriver() override; 20 ~SyntheticTouchDriver() override;
21 21
22 void DispatchEvent(SyntheticGestureTarget* target, 22 void DispatchEvent(SyntheticGestureTarget* target,
23 const base::TimeTicks& timestamp) override; 23 const base::TimeTicks& timestamp) override;
24 24
25 void Press(float x, float y, int index) override; 25 void Press(float x,
26 float y,
27 int index,
28 SyntheticPointerActionParams::Button button =
29 SyntheticPointerActionParams::Button::LEFT) override;
26 void Move(float x, float y, int index) override; 30 void Move(float x, float y, int index) override;
27 void Release(int index) override; 31 void Release(int index,
32 SyntheticPointerActionParams::Button button =
33 SyntheticPointerActionParams::Button::LEFT) override;
28 34
29 bool UserInputCheck( 35 bool UserInputCheck(
30 const SyntheticPointerActionParams& params) const override; 36 const SyntheticPointerActionParams& params) const override;
31 37
32 private: 38 private:
33 using IndexMap = std::array<int, blink::WebTouchEvent::kTouchesLengthCap>; 39 using IndexMap = std::array<int, blink::WebTouchEvent::kTouchesLengthCap>;
34 40
35 SyntheticWebTouchEvent touch_event_; 41 SyntheticWebTouchEvent touch_event_;
36 IndexMap index_map_; 42 IndexMap index_map_;
37 43
38 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchDriver); 44 DISALLOW_COPY_AND_ASSIGN(SyntheticTouchDriver);
39 }; 45 };
40 46
41 } // namespace content 47 } // namespace content
42 48
43 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_TOUCH_DRIVER_H_ 49 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_TOUCH_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698