| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 412 } | 412 } |
| 413 result.id = [event deviceID]; | 413 result.id = [event deviceID]; |
| 414 result.force = [event pressure]; | 414 result.force = [event pressure]; |
| 415 return result; | 415 return result; |
| 416 } | 416 } |
| 417 | 417 |
| 418 // WebMouseWheelEvent --------------------------------------------------------- | 418 // WebMouseWheelEvent --------------------------------------------------------- |
| 419 | 419 |
| 420 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build( | 420 blink::WebMouseWheelEvent WebMouseWheelEventBuilder::Build( |
| 421 NSEvent* event, | 421 NSEvent* event, |
| 422 NSView* view, | 422 NSView* view) { |
| 423 bool can_rubberband_left, | |
| 424 bool can_rubberband_right) { | |
| 425 blink::WebMouseWheelEvent result; | 423 blink::WebMouseWheelEvent result; |
| 426 | 424 |
| 427 result.type = blink::WebInputEvent::MouseWheel; | 425 result.type = blink::WebInputEvent::MouseWheel; |
| 428 result.button = blink::WebMouseEvent::ButtonNone; | 426 result.button = blink::WebMouseEvent::ButtonNone; |
| 429 | 427 |
| 430 result.modifiers = ModifiersFromEvent(event); | 428 result.modifiers = ModifiersFromEvent(event); |
| 431 | 429 |
| 432 SetWebEventLocationFromEventInView(&result, event, view); | 430 SetWebEventLocationFromEventInView(&result, event, view); |
| 433 | 431 |
| 434 result.canRubberbandLeft = can_rubberband_left; | |
| 435 result.canRubberbandRight = can_rubberband_right; | |
| 436 | |
| 437 // Of Mice and Men | 432 // Of Mice and Men |
| 438 // --------------- | 433 // --------------- |
| 439 // | 434 // |
| 440 // There are three types of scroll data available on a scroll wheel CGEvent. | 435 // There are three types of scroll data available on a scroll wheel CGEvent. |
| 441 // Apple's documentation ([1]) is rather vague in their differences, and not | 436 // Apple's documentation ([1]) is rather vague in their differences, and not |
| 442 // terribly helpful in deciding which to use. This is what's really going on. | 437 // terribly helpful in deciding which to use. This is what's really going on. |
| 443 // | 438 // |
| 444 // First, these events behave very differently depending on whether a standard | 439 // First, these events behave very differently depending on whether a standard |
| 445 // wheel mouse is used (one that scrolls in discrete units) or a | 440 // wheel mouse is used (one that scrolls in discrete units) or a |
| 446 // trackpad/Mighty Mouse is used (which both provide continuous scrolling). | 441 // trackpad/Mighty Mouse is used (which both provide continuous scrolling). |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 614 break; | 609 break; |
| 615 default: | 610 default: |
| 616 NOTIMPLEMENTED(); | 611 NOTIMPLEMENTED(); |
| 617 result.type = blink::WebInputEvent::Undefined; | 612 result.type = blink::WebInputEvent::Undefined; |
| 618 } | 613 } |
| 619 | 614 |
| 620 return result; | 615 return result; |
| 621 } | 616 } |
| 622 | 617 |
| 623 } // namespace content | 618 } // namespace content |
| OLD | NEW |