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

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

Issue 2349143004: Plumbing stylus tilt for Mac (Closed)
Patch Set: Change to lround Created 4 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 | « no previous file | no next file » | 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 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // For all other tablet events, the pointer type will be just pen. 406 // For all other tablet events, the pointer type will be just pen.
407 NSEventSubtype subtype = [event subtype]; 407 NSEventSubtype subtype = [event subtype];
408 if (subtype == NSTabletPointEventSubtype || 408 if (subtype == NSTabletPointEventSubtype ||
409 subtype == NSTabletProximityEventSubtype) { 409 subtype == NSTabletProximityEventSubtype) {
410 result.pointerType = blink::WebPointerProperties::PointerType::Pen; 410 result.pointerType = blink::WebPointerProperties::PointerType::Pen;
411 } else { 411 } else {
412 result.pointerType = blink::WebPointerProperties::PointerType::Mouse; 412 result.pointerType = blink::WebPointerProperties::PointerType::Mouse;
413 } 413 }
414 result.id = [event deviceID]; 414 result.id = [event deviceID];
415 result.force = [event pressure]; 415 result.force = [event pressure];
416 NSPoint tilt = [event tilt];
417 result.tiltX = lround(tilt.x * 90);
418 result.tiltY = lround(tilt.y * 90);
416 return result; 419 return result;
417 } 420 }
418 421
419 // WebMouseWheelEvent --------------------------------------------------------- 422 // WebMouseWheelEvent ---------------------------------------------------------
420 423
421 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build( 424 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build(
422 NSEvent* event, 425 NSEvent* event,
423 NSView* view) { 426 NSView* view) {
424 blink::WebMouseWheelEvent result; 427 blink::WebMouseWheelEvent result;
425 428
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
607 break; 610 break;
608 default: 611 default:
609 NOTIMPLEMENTED(); 612 NOTIMPLEMENTED();
610 result.type = blink::WebInputEvent::Undefined; 613 result.type = blink::WebInputEvent::Undefined;
611 } 614 }
612 615
613 return result; 616 return result;
614 } 617 }
615 618
616 } // namespace content 619 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698