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

Side by Side Diff: content/common/input/input_param_traits.cc

Issue 2336803003: Make SyntheticPointerAction to flush the pointer action sequence (Closed)
Patch Set: controller Created 4 years 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 | « content/common/BUILD.gn ('k') | content/common/input/input_param_traits_unittest.cc » ('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 #include "content/common/input/input_param_traits.h" 5 #include "content/common/input/input_param_traits.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/common/content_param_traits.h" 9 #include "content/common/content_param_traits.h"
10 #include "content/common/input/synthetic_pinch_gesture_params.h" 10 #include "content/common/input/synthetic_pinch_gesture_params.h"
11 #include "content/common/input/synthetic_pointer_action_params.h" 11 #include "content/common/input/synthetic_pointer_action_list_params.h"
12 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" 12 #include "content/common/input/synthetic_smooth_drag_gesture_params.h"
13 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" 13 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h"
14 #include "content/common/input_messages.h" 14 #include "content/common/input_messages.h"
15 #include "ui/events/blink/web_input_event_traits.h" 15 #include "ui/events/blink/web_input_event_traits.h"
16 16
17 namespace IPC { 17 namespace IPC {
18 namespace { 18 namespace {
19 template <typename GestureType> 19 template <typename GestureType>
20 std::unique_ptr<content::SyntheticGestureParams> ReadGestureParams( 20 std::unique_ptr<content::SyntheticGestureParams> ReadGestureParams(
21 const base::Pickle* m, 21 const base::Pickle* m,
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 p.gesture_params())); 78 p.gesture_params()));
79 break; 79 break;
80 case content::SyntheticGestureParams::PINCH_GESTURE: 80 case content::SyntheticGestureParams::PINCH_GESTURE:
81 WriteParam(m, *content::SyntheticPinchGestureParams::Cast( 81 WriteParam(m, *content::SyntheticPinchGestureParams::Cast(
82 p.gesture_params())); 82 p.gesture_params()));
83 break; 83 break;
84 case content::SyntheticGestureParams::TAP_GESTURE: 84 case content::SyntheticGestureParams::TAP_GESTURE:
85 WriteParam(m, *content::SyntheticTapGestureParams::Cast( 85 WriteParam(m, *content::SyntheticTapGestureParams::Cast(
86 p.gesture_params())); 86 p.gesture_params()));
87 break; 87 break;
88 case content::SyntheticGestureParams::POINTER_ACTION: 88 case content::SyntheticGestureParams::POINTER_ACTION_LIST:
89 WriteParam( 89 WriteParam(m, *content::SyntheticPointerActionListParams::Cast(
90 m, *content::SyntheticPointerActionParams::Cast(p.gesture_params())); 90 p.gesture_params()));
91 break; 91 break;
92 } 92 }
93 } 93 }
94 94
95 bool ParamTraits<content::SyntheticGesturePacket>::Read( 95 bool ParamTraits<content::SyntheticGesturePacket>::Read(
96 const base::Pickle* m, 96 const base::Pickle* m,
97 base::PickleIterator* iter, 97 base::PickleIterator* iter,
98 param_type* p) { 98 param_type* p) {
99 content::SyntheticGestureParams::GestureType gesture_type; 99 content::SyntheticGestureParams::GestureType gesture_type;
100 if (!ReadParam(m, iter, &gesture_type)) 100 if (!ReadParam(m, iter, &gesture_type))
(...skipping 10 matching lines...) Expand all
111 ReadGestureParams<content::SyntheticSmoothDragGestureParams>(m, iter); 111 ReadGestureParams<content::SyntheticSmoothDragGestureParams>(m, iter);
112 break; 112 break;
113 case content::SyntheticGestureParams::PINCH_GESTURE: 113 case content::SyntheticGestureParams::PINCH_GESTURE:
114 gesture_params = 114 gesture_params =
115 ReadGestureParams<content::SyntheticPinchGestureParams>(m, iter); 115 ReadGestureParams<content::SyntheticPinchGestureParams>(m, iter);
116 break; 116 break;
117 case content::SyntheticGestureParams::TAP_GESTURE: 117 case content::SyntheticGestureParams::TAP_GESTURE:
118 gesture_params = 118 gesture_params =
119 ReadGestureParams<content::SyntheticTapGestureParams>(m, iter); 119 ReadGestureParams<content::SyntheticTapGestureParams>(m, iter);
120 break; 120 break;
121 case content::SyntheticGestureParams::POINTER_ACTION: { 121 case content::SyntheticGestureParams::POINTER_ACTION_LIST:
122 gesture_params = 122 gesture_params =
123 ReadGestureParams<content::SyntheticPointerActionParams>(m, iter); 123 ReadGestureParams<content::SyntheticPointerActionListParams>(m, iter);
124 break; 124 break;
125 }
126 default: 125 default:
127 return false; 126 return false;
128 } 127 }
129 128
130 p->set_gesture_params(std::move(gesture_params)); 129 p->set_gesture_params(std::move(gesture_params));
131 return p->gesture_params() != NULL; 130 return p->gesture_params() != NULL;
132 } 131 }
133 132
134 void ParamTraits<content::SyntheticGesturePacket>::Log(const param_type& p, 133 void ParamTraits<content::SyntheticGesturePacket>::Log(const param_type& p,
135 std::string* l) { 134 std::string* l) {
(...skipping 13 matching lines...) Expand all
149 case content::SyntheticGestureParams::PINCH_GESTURE: 148 case content::SyntheticGestureParams::PINCH_GESTURE:
150 LogParam( 149 LogParam(
151 *content::SyntheticPinchGestureParams::Cast(p.gesture_params()), 150 *content::SyntheticPinchGestureParams::Cast(p.gesture_params()),
152 l); 151 l);
153 break; 152 break;
154 case content::SyntheticGestureParams::TAP_GESTURE: 153 case content::SyntheticGestureParams::TAP_GESTURE:
155 LogParam( 154 LogParam(
156 *content::SyntheticTapGestureParams::Cast(p.gesture_params()), 155 *content::SyntheticTapGestureParams::Cast(p.gesture_params()),
157 l); 156 l);
158 break; 157 break;
159 case content::SyntheticGestureParams::POINTER_ACTION: 158 case content::SyntheticGestureParams::POINTER_ACTION_LIST:
160 LogParam(*content::SyntheticPointerActionParams::Cast(p.gesture_params()), 159 LogParam(
161 l); 160 *content::SyntheticPointerActionListParams::Cast(p.gesture_params()),
161 l);
162 break; 162 break;
163 } 163 }
164 } 164 }
165 165
166 } // namespace IPC 166 } // namespace IPC
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/input/input_param_traits_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698