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

Side by Side Diff: content/browser/renderer_host/input/web_input_event_builders_mac.mm

Issue 2587393004: Add tangentialPressure and twist properties to PointerEvent on Mac (Closed)
Patch Set: rebase 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/pointerevents/idlharness-expected.txt » ('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 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 /* 5 /*
6 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
7 * Copyright (C) 2006-2009 Google Inc. 7 * Copyright (C) 2006-2009 Google Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 // Set stylus properties for events with a subtype of 338 // Set stylus properties for events with a subtype of
339 // NSTabletPointEventSubtype. 339 // NSTabletPointEventSubtype.
340 result.pointerType = blink::WebPointerProperties::PointerType::Pen; 340 result.pointerType = blink::WebPointerProperties::PointerType::Pen;
341 result.id = [event deviceID]; 341 result.id = [event deviceID];
342 if (subtype == NSTabletPointEventSubtype) { 342 if (subtype == NSTabletPointEventSubtype) {
343 result.force = [event pressure]; 343 result.force = [event pressure];
344 NSPoint tilt = [event tilt]; 344 NSPoint tilt = [event tilt];
345 result.tiltX = lround(tilt.x * 90); 345 result.tiltX = lround(tilt.x * 90);
346 result.tiltY = lround(tilt.y * 90); 346 result.tiltY = lround(tilt.y * 90);
347 result.tangentialPressure = [event tangentialPressure];
348 // NSEvent spec doesn't specify the range of rotation, we make sure that
349 // this value is in the range of [0,359].
350 int twist = (int)[event rotation];
351 twist = twist % 360;
352 if (twist < 0)
353 twist += 360;
354 result.twist = twist;
347 } 355 }
348 return result; 356 return result;
349 } 357 }
350 358
351 // WebMouseWheelEvent --------------------------------------------------------- 359 // WebMouseWheelEvent ---------------------------------------------------------
352 360
353 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build( 361 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
354 NSEvent* event, 362 NSEvent* event,
355 NSView* view) { 363 NSView* view) {
356 blink::WebMouseWheelEvent result(blink::WebInputEvent::MouseWheel, 364 blink::WebMouseWheelEvent result(blink::WebInputEvent::MouseWheel,
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // to specify them when the gesture is differentiated. 541 // to specify them when the gesture is differentiated.
534 break; 542 break;
535 default: 543 default:
536 NOTIMPLEMENTED(); 544 NOTIMPLEMENTED();
537 } 545 }
538 546
539 return result; 547 return result;
540 } 548 }
541 549
542 } // namespace content 550 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/external/wpt/pointerevents/idlharness-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698