| 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 2840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2851 float scale; | 2851 float scale; |
| 2852 IntPoint scroll; | 2852 IntPoint scroll; |
| 2853 bool needAnimation; | 2853 bool needAnimation; |
| 2854 computeScaleAndScrollForFocusedNode(element, zoomInToLegibleScale, scale, sc
roll, needAnimation); | 2854 computeScaleAndScrollForFocusedNode(element, zoomInToLegibleScale, scale, sc
roll, needAnimation); |
| 2855 if (needAnimation) | 2855 if (needAnimation) |
| 2856 return startPageScaleAnimation(scroll, false, scale, scrollAndScaleAnima
tionDurationInSeconds); | 2856 return startPageScaleAnimation(scroll, false, scale, scrollAndScaleAnima
tionDurationInSeconds); |
| 2857 | 2857 |
| 2858 return false; | 2858 return false; |
| 2859 } | 2859 } |
| 2860 | 2860 |
| 2861 void WebViewImpl::smoothScroll(int targetX, int targetY, long durationMs) |
| 2862 { |
| 2863 LocalFrame* frame = page()->mainFrame() && page()->mainFrame()->isLocalFrame
() |
| 2864 ? page()->deprecatedLocalMainFrame() : 0; |
| 2865 if (!frame || !frame->view()) |
| 2866 return; |
| 2867 |
| 2868 IntPoint targetPosition(targetX, targetY); |
| 2869 startPageScaleAnimation(targetPosition, false, pageScaleFactor(), (double)du
rationMs / 1000); |
| 2870 } |
| 2871 |
| 2861 void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, bool zo
omInToLegibleScale, float& newScale, IntPoint& newScroll, bool& needAnimation) | 2872 void WebViewImpl::computeScaleAndScrollForFocusedNode(Node* focusedNode, bool zo
omInToLegibleScale, float& newScale, IntPoint& newScroll, bool& needAnimation) |
| 2862 { | 2873 { |
| 2863 focusedNode->document().updateLayoutIgnorePendingStylesheets(); | 2874 focusedNode->document().updateLayoutIgnorePendingStylesheets(); |
| 2864 | 2875 |
| 2865 PinchViewport& pinchViewport = page()->frameHost().pinchViewport(); | 2876 PinchViewport& pinchViewport = page()->frameHost().pinchViewport(); |
| 2866 | 2877 |
| 2867 WebRect caretInViewport, unusedEnd; | 2878 WebRect caretInViewport, unusedEnd; |
| 2868 selectionBounds(caretInViewport, unusedEnd); | 2879 selectionBounds(caretInViewport, unusedEnd); |
| 2869 | 2880 |
| 2870 // 'caretInDocument' is rect encompassing the blinking cursor relative to th
e root document. | 2881 // 'caretInDocument' is rect encompassing the blinking cursor relative to th
e root document. |
| (...skipping 1514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4385 { | 4396 { |
| 4386 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); | 4397 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); |
| 4387 } | 4398 } |
| 4388 | 4399 |
| 4389 void WebViewImpl::forceNextDrawingBufferCreationToFail() | 4400 void WebViewImpl::forceNextDrawingBufferCreationToFail() |
| 4390 { | 4401 { |
| 4391 DrawingBuffer::forceNextDrawingBufferCreationToFail(); | 4402 DrawingBuffer::forceNextDrawingBufferCreationToFail(); |
| 4392 } | 4403 } |
| 4393 | 4404 |
| 4394 } // namespace blink | 4405 } // namespace blink |
| OLD | NEW |