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 2856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2867 float scale; | 2867 float scale; |
2868 IntPoint scroll; | 2868 IntPoint scroll; |
2869 bool needAnimation; | 2869 bool needAnimation; |
2870 computeScaleAndScrollForFocusedNode(element, zoomInToLegibleScale, scale, sc
roll, needAnimation); | 2870 computeScaleAndScrollForFocusedNode(element, zoomInToLegibleScale, scale, sc
roll, needAnimation); |
2871 if (needAnimation) | 2871 if (needAnimation) |
2872 return startPageScaleAnimation(scroll, false, scale, scrollAndScaleAnima
tionDurationInSeconds); | 2872 return startPageScaleAnimation(scroll, false, scale, scrollAndScaleAnima
tionDurationInSeconds); |
2873 | 2873 |
2874 return false; | 2874 return false; |
2875 } | 2875 } |
2876 | 2876 |
| 2877 void WebViewImpl::smoothScroll(int targetX, int targetY, long durationMs) |
| 2878 { |
| 2879 IntPoint targetPosition(targetX, targetY); |
| 2880 startPageScaleAnimation(targetPosition, false, pageScaleFactor(), (double)du
rationMs / 1000); |
| 2881 } |
| 2882 |
2877 void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, bool zo
omInToLegibleScale, float& newScale, IntPoint& newScroll, bool& needAnimation) | 2883 void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, bool zo
omInToLegibleScale, float& newScale, IntPoint& newScroll, bool& needAnimation) |
2878 { | 2884 { |
2879 focusedNode->document().updateLayoutIgnorePendingStylesheets(); | 2885 focusedNode->document().updateLayoutIgnorePendingStylesheets(); |
2880 | 2886 |
2881 PinchViewport& pinchViewport = page()->frameHost().pinchViewport(); | 2887 PinchViewport& pinchViewport = page()->frameHost().pinchViewport(); |
2882 | 2888 |
2883 WebRect caretInViewport, unusedEnd; | 2889 WebRect caretInViewport, unusedEnd; |
2884 selectionBounds(caretInViewport, unusedEnd); | 2890 selectionBounds(caretInViewport, unusedEnd); |
2885 | 2891 |
2886 // 'caretInDocument' is rect encompassing the blinking cursor relative to th
e root document. | 2892 // 'caretInDocument' is rect encompassing the blinking cursor relative to th
e root document. |
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4415 { | 4421 { |
4416 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4422 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
4417 } | 4423 } |
4418 | 4424 |
4419 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4425 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
4420 { | 4426 { |
4421 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4427 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
4422 } | 4428 } |
4423 | 4429 |
4424 } // namespace blink | 4430 } // namespace blink |
OLD | NEW |