| 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 // - magnitude roughly matches wheels: f(2) > 25 && f(2) < 100 | 942 // - magnitude roughly matches wheels: f(2) > 25 && f(2) < 100 |
| 943 // - a formula that's relatively easy to use from JavaScript | 943 // - a formula that's relatively easy to use from JavaScript |
| 944 // Note that 'wheel' event deltaY values have their sign inverted. So to | 944 // Note that 'wheel' event deltaY values have their sign inverted. So to |
| 945 // convert a wheel deltaY back to a scale use Math.exp(-deltaY/100). | 945 // convert a wheel deltaY back to a scale use Math.exp(-deltaY/100). |
| 946 DCHECK_GT(pinchEvent.data.pinchUpdate.scale, 0); | 946 DCHECK_GT(pinchEvent.data.pinchUpdate.scale, 0); |
| 947 wheelEvent.deltaY = 100.0f * log(pinchEvent.data.pinchUpdate.scale); | 947 wheelEvent.deltaY = 100.0f * log(pinchEvent.data.pinchUpdate.scale); |
| 948 wheelEvent.hasPreciseScrollingDeltas = true; | 948 wheelEvent.hasPreciseScrollingDeltas = true; |
| 949 wheelEvent.wheelTicksX = 0; | 949 wheelEvent.wheelTicksX = 0; |
| 950 wheelEvent.wheelTicksY = | 950 wheelEvent.wheelTicksY = |
| 951 pinchEvent.data.pinchUpdate.scale > 1 ? 1 : -1; | 951 pinchEvent.data.pinchUpdate.scale > 1 ? 1 : -1; |
| 952 wheelEvent.canScroll = false; | |
| 953 | 952 |
| 954 return handleInputEvent(wheelEvent); | 953 return handleInputEvent(wheelEvent); |
| 955 } | 954 } |
| 956 | 955 |
| 957 void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar
ameters& parameters) | 956 void WebViewImpl::transferActiveWheelFlingAnimation(const WebActiveWheelFlingPar
ameters& parameters) |
| 958 { | 957 { |
| 959 TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); | 958 TRACE_EVENT0("blink", "WebViewImpl::transferActiveWheelFlingAnimation"); |
| 960 DCHECK(!m_gestureAnimation); | 959 DCHECK(!m_gestureAnimation); |
| 961 m_positionOnFlingStart = parameters.point; | 960 m_positionOnFlingStart = parameters.point; |
| 962 m_globalPositionOnFlingStart = parameters.globalPoint; | 961 m_globalPositionOnFlingStart = parameters.globalPoint; |
| (...skipping 3601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4564 { | 4563 { |
| 4565 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4564 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
| 4566 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4565 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4567 if (!page()) | 4566 if (!page()) |
| 4568 return 1; | 4567 return 1; |
| 4569 | 4568 |
| 4570 return page()->deviceScaleFactor(); | 4569 return page()->deviceScaleFactor(); |
| 4571 } | 4570 } |
| 4572 | 4571 |
| 4573 } // namespace blink | 4572 } // namespace blink |
| OLD | NEW |