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