| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |