OLD | NEW |
---|---|
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 CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ |
6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ | 6 #define CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ |
7 | 7 |
8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" | 9 #include "content/browser/devtools/protocol/devtools_protocol_dispatcher.h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 Response EmulateTouchFromMouseEvent(const std::string& type, | 62 Response EmulateTouchFromMouseEvent(const std::string& type, |
63 int x, | 63 int x, |
64 int y, | 64 int y, |
65 double timestamp, | 65 double timestamp, |
66 const std::string& button, | 66 const std::string& button, |
67 double* delta_x, | 67 double* delta_x, |
68 double* delta_y, | 68 double* delta_y, |
69 int* modifiers, | 69 int* modifiers, |
70 int* click_count); | 70 int* click_count); |
71 | 71 |
72 Response SynthesizePinchGesture(DevToolsCommandId command_id, | 72 Response SynthesizePinchGesture(int session_id, |
dgozman
2015/11/06 22:57:27
Encapsulate session id into DevToolsCommandId.
kozy
2015/11/07 01:54:44
Done.
| |
73 DevToolsCommandId command_id, | |
73 int x, | 74 int x, |
74 int y, | 75 int y, |
75 double scale_factor, | 76 double scale_factor, |
76 const int* relative_speed, | 77 const int* relative_speed, |
77 const std::string* gesture_source_type); | 78 const std::string* gesture_source_type); |
78 | 79 |
79 Response SynthesizeScrollGesture(DevToolsCommandId command_id, | 80 Response SynthesizeScrollGesture(int session_id, |
81 DevToolsCommandId command_id, | |
80 int x, | 82 int x, |
81 int y, | 83 int y, |
82 const int* x_distance, | 84 const int* x_distance, |
83 const int* y_distance, | 85 const int* y_distance, |
84 const int* x_overscroll, | 86 const int* x_overscroll, |
85 const int* y_overscroll, | 87 const int* y_overscroll, |
86 const bool* prevent_fling, | 88 const bool* prevent_fling, |
87 const int* speed, | 89 const int* speed, |
88 const std::string* gesture_source_type, | 90 const std::string* gesture_source_type, |
89 const int* repeat_count, | 91 const int* repeat_count, |
90 const int* repeat_delay_ms, | 92 const int* repeat_delay_ms, |
91 const std::string* interaction_marker_name); | 93 const std::string* interaction_marker_name); |
92 | 94 |
93 Response SynthesizeTapGesture(DevToolsCommandId command_id, | 95 Response SynthesizeTapGesture(int session_id, |
96 DevToolsCommandId command_id, | |
94 int x, | 97 int x, |
95 int y, | 98 int y, |
96 const int* duration, | 99 const int* duration, |
97 const int* tap_count, | 100 const int* tap_count, |
98 const std::string* gesture_source_type); | 101 const std::string* gesture_source_type); |
99 | 102 |
100 private: | 103 private: |
101 void SendSynthesizePinchGestureResponse(DevToolsCommandId command_id, | 104 void SendSynthesizePinchGestureResponse(int session_id, |
105 DevToolsCommandId command_id, | |
102 SyntheticGesture::Result result); | 106 SyntheticGesture::Result result); |
103 | 107 |
104 void SendSynthesizeScrollGestureResponse(DevToolsCommandId command_id, | 108 void SendSynthesizeScrollGestureResponse(int session_id, |
109 DevToolsCommandId command_id, | |
105 SyntheticGesture::Result result); | 110 SyntheticGesture::Result result); |
106 | 111 |
107 void SendSynthesizeTapGestureResponse(DevToolsCommandId command_id, | 112 void SendSynthesizeTapGestureResponse(int session_id, |
113 DevToolsCommandId command_id, | |
108 bool send_success, | 114 bool send_success, |
109 SyntheticGesture::Result result); | 115 SyntheticGesture::Result result); |
110 | 116 |
111 void SynthesizeRepeatingScroll( | 117 void SynthesizeRepeatingScroll( |
112 SyntheticSmoothScrollGestureParams gesture_params, | 118 SyntheticSmoothScrollGestureParams gesture_params, |
113 int repeat_count, | 119 int repeat_count, |
114 base::TimeDelta repeat_delay, | 120 base::TimeDelta repeat_delay, |
115 std::string interaction_marker_name, | 121 std::string interaction_marker_name, |
122 int session_id, | |
116 DevToolsCommandId command_id); | 123 DevToolsCommandId command_id); |
117 | 124 |
118 void OnScrollFinished(SyntheticSmoothScrollGestureParams gesture_params, | 125 void OnScrollFinished(SyntheticSmoothScrollGestureParams gesture_params, |
119 int repeat_count, | 126 int repeat_count, |
120 base::TimeDelta repeat_delay, | 127 base::TimeDelta repeat_delay, |
121 std::string interaction_marker_name, | 128 std::string interaction_marker_name, |
129 int session_id, | |
122 DevToolsCommandId command_id, | 130 DevToolsCommandId command_id, |
123 SyntheticGesture::Result result); | 131 SyntheticGesture::Result result); |
124 | 132 |
125 RenderWidgetHostImpl* host_; | 133 RenderWidgetHostImpl* host_; |
126 scoped_ptr<Client> client_; | 134 scoped_ptr<Client> client_; |
127 float page_scale_factor_; | 135 float page_scale_factor_; |
128 gfx::SizeF scrollable_viewport_size_; | 136 gfx::SizeF scrollable_viewport_size_; |
129 base::WeakPtrFactory<InputHandler> weak_factory_; | 137 base::WeakPtrFactory<InputHandler> weak_factory_; |
130 | 138 |
131 DISALLOW_COPY_AND_ASSIGN(InputHandler); | 139 DISALLOW_COPY_AND_ASSIGN(InputHandler); |
132 }; | 140 }; |
133 | 141 |
134 } // namespace input | 142 } // namespace input |
135 } // namespace devtools | 143 } // namespace devtools |
136 } // namespace content | 144 } // namespace content |
137 | 145 |
138 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ | 146 #endif // CONTENT_BROWSER_DEVTOOLS_PROTOCOL_INPUT_HANDLER_H_ |
OLD | NEW |