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

Side by Side Diff: mojo/converters/input_events/input_events_type_converters.cc

Issue 1300803003: Drop ui::TouchEvent shims for radius_{x,y} and force (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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
« no previous file with comments | « ash/touch/touch_uma.cc ('k') | ui/events/event.h » ('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 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 #include "mojo/converters/input_events/input_events_type_converters.h" 5 #include "mojo/converters/input_events/input_events_type_converters.h"
6 6
7 #if defined(USE_X11) 7 #if defined(USE_X11)
8 #include <X11/extensions/XInput2.h> 8 #include <X11/extensions/XInput2.h>
9 #include <X11/Xlib.h> 9 #include <X11/Xlib.h>
10 #endif 10 #endif
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 static_cast<float>(wheel_event->y_offset()) / 100.0f; 186 static_cast<float>(wheel_event->y_offset()) / 100.0f;
187 } 187 }
188 event->pointer_data = pointer_data.Pass(); 188 event->pointer_data = pointer_data.Pass();
189 } else if (input.IsTouchEvent()) { 189 } else if (input.IsTouchEvent()) {
190 const ui::TouchEvent* touch_event = 190 const ui::TouchEvent* touch_event =
191 static_cast<const ui::TouchEvent*>(&input); 191 static_cast<const ui::TouchEvent*>(&input);
192 PointerDataPtr pointer_data(PointerData::New()); 192 PointerDataPtr pointer_data(PointerData::New());
193 pointer_data->pointer_id = touch_event->touch_id(); 193 pointer_data->pointer_id = touch_event->touch_id();
194 pointer_data->kind = POINTER_KIND_TOUCH; 194 pointer_data->kind = POINTER_KIND_TOUCH;
195 SetPointerDataLocationFromEvent(*touch_event, pointer_data.get()); 195 SetPointerDataLocationFromEvent(*touch_event, pointer_data.get());
196 pointer_data->radius_major = touch_event->radius_x(); 196 pointer_data->radius_major = touch_event->pointer_details().radius_x();
197 pointer_data->radius_minor = touch_event->radius_y(); 197 pointer_data->radius_minor = touch_event->pointer_details().radius_y();
198 pointer_data->pressure = touch_event->force(); 198 pointer_data->pressure = touch_event->pointer_details().force();
199 pointer_data->orientation = touch_event->rotation_angle(); 199 pointer_data->orientation = touch_event->rotation_angle();
200 event->pointer_data = pointer_data.Pass(); 200 event->pointer_data = pointer_data.Pass();
201 } else if (input.IsKeyEvent()) { 201 } else if (input.IsKeyEvent()) {
202 const ui::KeyEvent* key_event = static_cast<const ui::KeyEvent*>(&input); 202 const ui::KeyEvent* key_event = static_cast<const ui::KeyEvent*>(&input);
203 KeyDataPtr key_data(KeyData::New()); 203 KeyDataPtr key_data(KeyData::New());
204 key_data->key_code = key_event->GetConflatedWindowsKeyCode(); 204 key_data->key_code = key_event->GetConflatedWindowsKeyCode();
205 key_data->native_key_code = key_event->platform_keycode(); 205 key_data->native_key_code = key_event->platform_keycode();
206 key_data->is_char = key_event->is_char(); 206 key_data->is_char = key_event->is_char();
207 key_data->character = key_event->GetCharacter(); 207 key_data->character = key_event->GetCharacter();
208 208
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 return touch_event.Pass(); 299 return touch_event.Pass();
300 } 300 }
301 default: 301 default:
302 NOTIMPLEMENTED(); 302 NOTIMPLEMENTED();
303 } 303 }
304 // TODO: need to support time_stamp. 304 // TODO: need to support time_stamp.
305 return nullptr; 305 return nullptr;
306 } 306 }
307 307
308 } // namespace mojo 308 } // namespace mojo
OLDNEW
« no previous file with comments | « ash/touch/touch_uma.cc ('k') | ui/events/event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698