| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 syntheticWheel.wheelTicksY = delta.height / tickDivisor; | 678 syntheticWheel.wheelTicksY = delta.height / tickDivisor; |
| 679 syntheticWheel.hasPreciseScrollingDeltas = true; | 679 syntheticWheel.hasPreciseScrollingDeltas = true; |
| 680 syntheticWheel.x = m_positionOnFlingStart.x; | 680 syntheticWheel.x = m_positionOnFlingStart.x; |
| 681 syntheticWheel.y = m_positionOnFlingStart.y; | 681 syntheticWheel.y = m_positionOnFlingStart.y; |
| 682 syntheticWheel.globalX = m_globalPositionOnFlingStart.x; | 682 syntheticWheel.globalX = m_globalPositionOnFlingStart.x; |
| 683 syntheticWheel.globalY = m_globalPositionOnFlingStart.y; | 683 syntheticWheel.globalY = m_globalPositionOnFlingStart.y; |
| 684 syntheticWheel.modifiers = m_flingModifier; | 684 syntheticWheel.modifiers = m_flingModifier; |
| 685 | 685 |
| 686 if (handleMouseWheel(*m_page->deprecatedLocalMainFrame(), syntheticWheel
) != WebInputEventResult::NotHandled) | 686 if (handleMouseWheel(*m_page->deprecatedLocalMainFrame(), syntheticWheel
) != WebInputEventResult::NotHandled) |
| 687 return true; | 687 return true; |
| 688 if (!m_webSettings->wheelGesturesEnabled()) | |
| 689 return false; | |
| 690 | 688 |
| 691 // TODO(dtapuska): Remove these GSB/GSE sequences when trackpad latching
is implemented; see crbug.com/526463. | 689 // TODO(dtapuska): Remove these GSB/GSE sequences when trackpad latching
is implemented; see crbug.com/526463. |
| 692 WebGestureEvent syntheticScrollBegin = createGestureScrollEventFromFling
(WebInputEvent::GestureScrollBegin, WebGestureDeviceTouchpad); | 690 WebGestureEvent syntheticScrollBegin = createGestureScrollEventFromFling
(WebInputEvent::GestureScrollBegin, WebGestureDeviceTouchpad); |
| 693 syntheticScrollBegin.data.scrollBegin.deltaXHint = delta.width; | 691 syntheticScrollBegin.data.scrollBegin.deltaXHint = delta.width; |
| 694 syntheticScrollBegin.data.scrollBegin.deltaYHint = delta.height; | 692 syntheticScrollBegin.data.scrollBegin.deltaYHint = delta.height; |
| 695 syntheticScrollBegin.data.scrollBegin.inertialPhase = WebGestureEvent::M
omentumPhase; | 693 syntheticScrollBegin.data.scrollBegin.inertialPhase = WebGestureEvent::M
omentumPhase; |
| 696 handleGestureEvent(syntheticScrollBegin); | 694 handleGestureEvent(syntheticScrollBegin); |
| 697 | 695 |
| 698 WebGestureEvent syntheticScrollUpdate = createGestureScrollEventFromFlin
g(WebInputEvent::GestureScrollUpdate, WebGestureDeviceTouchpad); | 696 WebGestureEvent syntheticScrollUpdate = createGestureScrollEventFromFlin
g(WebInputEvent::GestureScrollUpdate, WebGestureDeviceTouchpad); |
| 699 syntheticScrollUpdate.data.scrollUpdate.deltaX = delta.width; | 697 syntheticScrollUpdate.data.scrollUpdate.deltaX = delta.width; |
| (...skipping 3853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4553 { | 4551 { |
| 4554 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4552 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4555 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4553 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4556 if (!page()) | 4554 if (!page()) |
| 4557 return 1; | 4555 return 1; |
| 4558 | 4556 |
| 4559 return page()->deviceScaleFactor(); | 4557 return page()->deviceScaleFactor(); |
| 4560 } | 4558 } |
| 4561 | 4559 |
| 4562 } // namespace blink | 4560 } // namespace blink |
| OLD | NEW |