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 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
500 } | 500 } |
501 | 501 |
502 blink::WebGestureEvent WebGestureEventBuilder::Build(NSEvent* event, | 502 blink::WebGestureEvent WebGestureEventBuilder::Build(NSEvent* event, |
503 NSView* view) { | 503 NSView* view) { |
504 blink::WebGestureEvent result; | 504 blink::WebGestureEvent result; |
505 | 505 |
506 // Use a temporary WebMouseEvent to get the location. | 506 // Use a temporary WebMouseEvent to get the location. |
507 blink::WebMouseEvent temp; | 507 blink::WebMouseEvent temp; |
508 | 508 |
509 SetWebEventLocationFromEventInView(&temp, event, view); | 509 SetWebEventLocationFromEventInView(&temp, event, view); |
510 result.x = temp.x; | 510 result.x = temp.positionInWidget().x; |
dtapuska
2017/03/31 14:04:18
We should probably fix WebGestureEvent next eh?
mustaq
2017/03/31 15:50:31
Added a TODO in WebGestureEvent.h .
| |
511 result.y = temp.y; | 511 result.y = temp.positionInWidget().y; |
512 result.globalX = temp.globalX; | 512 result.globalX = temp.positionInScreen().x; |
513 result.globalY = temp.globalY; | 513 result.globalY = temp.positionInScreen().y; |
514 | 514 |
515 result.setModifiers(ModifiersFromEvent(event)); | 515 result.setModifiers(ModifiersFromEvent(event)); |
516 result.setTimeStampSeconds([event timestamp]); | 516 result.setTimeStampSeconds([event timestamp]); |
517 | 517 |
518 result.sourceDevice = blink::WebGestureDeviceTouchpad; | 518 result.sourceDevice = blink::WebGestureDeviceTouchpad; |
519 switch ([event type]) { | 519 switch ([event type]) { |
520 case NSEventTypeMagnify: | 520 case NSEventTypeMagnify: |
521 result.setType(blink::WebInputEvent::GesturePinchUpdate); | 521 result.setType(blink::WebInputEvent::GesturePinchUpdate); |
522 result.data.pinchUpdate.scale = [event magnification] + 1.0; | 522 result.data.pinchUpdate.scale = [event magnification] + 1.0; |
523 break; | 523 break; |
(...skipping 12 matching lines...) Expand all Loading... | |
536 // to specify them when the gesture is differentiated. | 536 // to specify them when the gesture is differentiated. |
537 break; | 537 break; |
538 default: | 538 default: |
539 NOTIMPLEMENTED(); | 539 NOTIMPLEMENTED(); |
540 } | 540 } |
541 | 541 |
542 return result; | 542 return result; |
543 } | 543 } |
544 | 544 |
545 } // namespace content | 545 } // namespace content |
OLD | NEW |