| 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 { | 896 { |
| 897 PinchViewport& pinchViewport = page()->frameHost().pinchViewport(); | 897 PinchViewport& pinchViewport = page()->frameHost().pinchViewport(); |
| 898 WebPoint clampedPoint = targetPosition; | 898 WebPoint clampedPoint = targetPosition; |
| 899 if (!useAnchor) { | 899 if (!useAnchor) { |
| 900 clampedPoint = pinchViewport.clampDocumentOffsetAtScale(targetPosition,
newScale); | 900 clampedPoint = pinchViewport.clampDocumentOffsetAtScale(targetPosition,
newScale); |
| 901 if (!durationInSeconds) { | 901 if (!durationInSeconds) { |
| 902 setPageScaleFactor(newScale); | 902 setPageScaleFactor(newScale); |
| 903 | 903 |
| 904 FrameView* view = mainFrameImpl()->frameView(); | 904 FrameView* view = mainFrameImpl()->frameView(); |
| 905 if (view && view->scrollableArea()) | 905 if (view && view->scrollableArea()) |
| 906 view->scrollableArea()->setScrollPosition(DoublePoint(clampedPoi
nt.x, clampedPoint.y)); | 906 view->scrollableArea()->setScrollPosition(DoublePoint(clampedPoi
nt.x, clampedPoint.y), ProgrammaticScroll); |
| 907 | 907 |
| 908 return false; | 908 return false; |
| 909 } | 909 } |
| 910 } | 910 } |
| 911 if (useAnchor && newScale == pageScaleFactor()) | 911 if (useAnchor && newScale == pageScaleFactor()) |
| 912 return false; | 912 return false; |
| 913 | 913 |
| 914 if (m_enableFakePageScaleAnimationForTesting) { | 914 if (m_enableFakePageScaleAnimationForTesting) { |
| 915 m_fakePageScaleAnimationTargetPosition = targetPosition; | 915 m_fakePageScaleAnimationTargetPosition = targetPosition; |
| 916 m_fakePageScaleAnimationUseAnchor = useAnchor; | 916 m_fakePageScaleAnimationUseAnchor = useAnchor; |
| (...skipping 2139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3056 if (!mainFrameImpl()) | 3056 if (!mainFrameImpl()) |
| 3057 return; | 3057 return; |
| 3058 | 3058 |
| 3059 FrameView * view = mainFrameImpl()->frameView(); | 3059 FrameView * view = mainFrameImpl()->frameView(); |
| 3060 if (!view) | 3060 if (!view) |
| 3061 return; | 3061 return; |
| 3062 | 3062 |
| 3063 // Order is important: pinch viewport location is clamped based on | 3063 // Order is important: pinch viewport location is clamped based on |
| 3064 // main frame scroll position and pinch viewport scale. | 3064 // main frame scroll position and pinch viewport scale. |
| 3065 | 3065 |
| 3066 view->setScrollOffset(mainFrameOrigin); | 3066 view->setScrollPosition(mainFrameOrigin, ProgrammaticScroll); |
| 3067 | 3067 |
| 3068 setPageScaleFactor(scaleFactor); | 3068 setPageScaleFactor(scaleFactor); |
| 3069 | 3069 |
| 3070 page()->frameHost().pinchViewport().setLocation(pinchViewportOrigin); | 3070 page()->frameHost().pinchViewport().setLocation(pinchViewportOrigin); |
| 3071 } | 3071 } |
| 3072 | 3072 |
| 3073 void WebViewImpl::setPageScaleFactorAndLocation(float scaleFactor, const FloatPo
int& location) | 3073 void WebViewImpl::setPageScaleFactorAndLocation(float scaleFactor, const FloatPo
int& location) |
| 3074 { | 3074 { |
| 3075 ASSERT(page()); | 3075 ASSERT(page()); |
| 3076 | 3076 |
| (...skipping 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4405 { | 4405 { |
| 4406 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4406 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4407 } | 4407 } |
| 4408 | 4408 |
| 4409 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4409 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
| 4410 { | 4410 { |
| 4411 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4411 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
| 4412 } | 4412 } |
| 4413 | 4413 |
| 4414 } // namespace blink | 4414 } // namespace blink |
| OLD | NEW |