| 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 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 927 | 927 |
| 928 // Reset the delegate to prevent notifications being sent as we're being | 928 // Reset the delegate to prevent notifications being sent as we're being |
| 929 // deleted. | 929 // deleted. |
| 930 m_client = 0; | 930 m_client = 0; |
| 931 | 931 |
| 932 deref(); // Balances ref() acquired in WebView::create | 932 deref(); // Balances ref() acquired in WebView::create |
| 933 } | 933 } |
| 934 | 934 |
| 935 void WebViewImpl::willStartLiveResize() | 935 void WebViewImpl::willStartLiveResize() |
| 936 { | 936 { |
| 937 if (mainFrameImpl() && mainFrameImpl()->frameView()) | 937 // FIXME(sky): Remove |
| 938 mainFrameImpl()->frameView()->willStartLiveResize(); | |
| 939 } | 938 } |
| 940 | 939 |
| 941 WebSize WebViewImpl::size() | 940 WebSize WebViewImpl::size() |
| 942 { | 941 { |
| 943 return m_size; | 942 return m_size; |
| 944 } | 943 } |
| 945 | 944 |
| 946 void WebViewImpl::resizePinchViewport(const WebSize& newSize) | 945 void WebViewImpl::resizePinchViewport(const WebSize& newSize) |
| 947 { | 946 { |
| 948 if (!pinchVirtualViewportEnabled()) | 947 if (!pinchVirtualViewportEnabled()) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 980 if (!view) | 979 if (!view) |
| 981 return; | 980 return; |
| 982 | 981 |
| 983 m_size = newSize; | 982 m_size = newSize; |
| 984 performResize(); | 983 performResize(); |
| 985 sendResizeEventAndRepaint(); | 984 sendResizeEventAndRepaint(); |
| 986 } | 985 } |
| 987 | 986 |
| 988 void WebViewImpl::willEndLiveResize() | 987 void WebViewImpl::willEndLiveResize() |
| 989 { | 988 { |
| 990 if (mainFrameImpl() && mainFrameImpl()->frameView()) | 989 // FIXME(sky): Remove |
| 991 mainFrameImpl()->frameView()->willEndLiveResize(); | |
| 992 } | 990 } |
| 993 | 991 |
| 994 void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) | 992 void WebViewImpl::beginFrame(const WebBeginFrameArgs& frameTime) |
| 995 { | 993 { |
| 996 TRACE_EVENT0("blink", "WebViewImpl::beginFrame"); | 994 TRACE_EVENT0("blink", "WebViewImpl::beginFrame"); |
| 997 | 995 |
| 998 WebBeginFrameArgs validFrameTime(frameTime); | 996 WebBeginFrameArgs validFrameTime(frameTime); |
| 999 if (!validFrameTime.lastFrameTimeMonotonic) | 997 if (!validFrameTime.lastFrameTimeMonotonic) |
| 1000 validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime(); | 998 validFrameTime.lastFrameTimeMonotonic = monotonicallyIncreasingTime(); |
| 1001 | 999 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 } | 1099 } |
| 1102 | 1100 |
| 1103 void WebViewImpl::clearCompositedSelectionBounds() | 1101 void WebViewImpl::clearCompositedSelectionBounds() |
| 1104 { | 1102 { |
| 1105 if (m_layerTreeView) | 1103 if (m_layerTreeView) |
| 1106 m_layerTreeView->clearSelection(); | 1104 m_layerTreeView->clearSelection(); |
| 1107 } | 1105 } |
| 1108 | 1106 |
| 1109 bool WebViewImpl::hasHorizontalScrollbar() | 1107 bool WebViewImpl::hasHorizontalScrollbar() |
| 1110 { | 1108 { |
| 1111 return mainFrameImpl()->frameView()->horizontalScrollbar(); | 1109 // FIXME(sky): Remove |
| 1110 return false; |
| 1112 } | 1111 } |
| 1113 | 1112 |
| 1114 bool WebViewImpl::hasVerticalScrollbar() | 1113 bool WebViewImpl::hasVerticalScrollbar() |
| 1115 { | 1114 { |
| 1116 return mainFrameImpl()->frameView()->verticalScrollbar(); | 1115 // FIXME(sky): Remove |
| 1116 return false; |
| 1117 } | 1117 } |
| 1118 | 1118 |
| 1119 const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; | 1119 const WebInputEvent* WebViewImpl::m_currentInputEvent = 0; |
| 1120 | 1120 |
| 1121 // FIXME: autogenerate this kind of code, and use it throughout Blink rather tha
n | 1121 // FIXME: autogenerate this kind of code, and use it throughout Blink rather tha
n |
| 1122 // the one-offs for subsets of these values. | 1122 // the one-offs for subsets of these values. |
| 1123 static String inputTypeToName(WebInputEvent::Type type) | 1123 static String inputTypeToName(WebInputEvent::Type type) |
| 1124 { | 1124 { |
| 1125 switch (type) { | 1125 switch (type) { |
| 1126 case WebInputEvent::MouseDown: | 1126 case WebInputEvent::MouseDown: |
| (...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1935 | 1935 |
| 1936 layout(); | 1936 layout(); |
| 1937 FontCachePurgePreventer fontCachePurgePreventer; // Required by minPreferred
LogicalWidth(). | 1937 FontCachePurgePreventer fontCachePurgePreventer; // Required by minPreferred
LogicalWidth(). |
| 1938 IntSize preferredMinimumSize(document->renderView()->minPreferredLogicalWidt
h(), document->documentElement()->scrollHeight()); | 1938 IntSize preferredMinimumSize(document->renderView()->minPreferredLogicalWidt
h(), document->documentElement()->scrollHeight()); |
| 1939 preferredMinimumSize.scale(zoomLevelToZoomFactor(zoomLevel())); | 1939 preferredMinimumSize.scale(zoomLevelToZoomFactor(zoomLevel())); |
| 1940 return preferredMinimumSize; | 1940 return preferredMinimumSize; |
| 1941 } | 1941 } |
| 1942 | 1942 |
| 1943 void WebViewImpl::resetScrollAndScaleState() | 1943 void WebViewImpl::resetScrollAndScaleState() |
| 1944 { | 1944 { |
| 1945 // TODO: This is done by the pinchViewport().reset() call below and can be r
emoved when | 1945 // FIXME(sky): Remove |
| 1946 // the new pinch path is the only one. | |
| 1947 updateMainFrameScrollPosition(IntPoint(), true); | |
| 1948 page()->frameHost().pinchViewport().reset(); | |
| 1949 | |
| 1950 // Clobber saved scales and scroll offsets. | |
| 1951 if (FrameView* view = page()->mainFrame()->document()->view()) | |
| 1952 view->cacheCurrentScrollPosition(); | |
| 1953 } | 1946 } |
| 1954 | 1947 |
| 1955 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) | 1948 void WebViewImpl::setFixedLayoutSize(const WebSize& layoutSize) |
| 1956 { | 1949 { |
| 1957 if (!page()) | 1950 if (!page()) |
| 1958 return; | 1951 return; |
| 1959 | 1952 |
| 1960 LocalFrame* frame = page()->mainFrame(); | 1953 LocalFrame* frame = page()->mainFrame(); |
| 1961 if (!frame) | 1954 if (!frame) |
| 1962 return; | 1955 return; |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2445 m_isAcceleratedCompositingActive = true; | 2438 m_isAcceleratedCompositingActive = true; |
| 2446 if (m_pageOverlays) | 2439 if (m_pageOverlays) |
| 2447 m_pageOverlays->update(); | 2440 m_pageOverlays->update(); |
| 2448 m_layerTreeView->setShowFPSCounter(m_showFPSCounter); | 2441 m_layerTreeView->setShowFPSCounter(m_showFPSCounter); |
| 2449 m_layerTreeView->setShowPaintRects(m_showPaintRects); | 2442 m_layerTreeView->setShowPaintRects(m_showPaintRects); |
| 2450 m_layerTreeView->setShowDebugBorders(m_showDebugBorders); | 2443 m_layerTreeView->setShowDebugBorders(m_showDebugBorders); |
| 2451 m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEnable
d); | 2444 m_layerTreeView->setContinuousPaintingEnabled(m_continuousPaintingEnable
d); |
| 2452 m_layerTreeView->setShowScrollBottleneckRects(m_showScrollBottleneckRect
s); | 2445 m_layerTreeView->setShowScrollBottleneckRects(m_showScrollBottleneckRect
s); |
| 2453 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); | 2446 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); |
| 2454 } | 2447 } |
| 2455 if (page()) | |
| 2456 page()->mainFrame()->view()->setClipsRepaints(!m_isAcceleratedCompositin
gActive); | |
| 2457 } | 2448 } |
| 2458 | 2449 |
| 2459 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition,
bool programmaticScroll) | 2450 void WebViewImpl::updateMainFrameScrollPosition(const IntPoint& scrollPosition,
bool programmaticScroll) |
| 2460 { | 2451 { |
| 2461 FrameView* frameView = page()->mainFrame()->view(); | 2452 // FIXME(sky): Remove |
| 2462 if (!frameView) | |
| 2463 return; | |
| 2464 | |
| 2465 if (frameView->scrollPosition() == scrollPosition) | |
| 2466 return; | |
| 2467 | |
| 2468 bool oldProgrammaticScroll = frameView->inProgrammaticScroll(); | |
| 2469 frameView->setInProgrammaticScroll(programmaticScroll); | |
| 2470 frameView->notifyScrollPositionChanged(scrollPosition); | |
| 2471 frameView->setInProgrammaticScroll(oldProgrammaticScroll); | |
| 2472 } | 2453 } |
| 2473 | 2454 |
| 2474 void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal
eDelta) | 2455 void WebViewImpl::applyScrollAndScale(const WebSize& scrollDelta, float pageScal
eDelta) |
| 2475 { | 2456 { |
| 2476 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 2457 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 2477 return; | 2458 return; |
| 2478 | 2459 |
| 2479 // TODO(bokan): Old pinch path only - virtual viewport pinch scrolls are aut
omatically updated via GraphicsLayer::DidScroll. | 2460 // TODO(bokan): Old pinch path only - virtual viewport pinch scrolls are aut
omatically updated via GraphicsLayer::DidScroll. |
| 2480 // this should be removed once old pinch is removed. | 2461 // this should be removed once old pinch is removed. |
| 2481 TRACE_EVENT_INSTANT2("blink", "WebViewImpl::applyScrollAndScale::scrollB
y", "x", scrollDelta.width, "y", scrollDelta.height); | 2462 TRACE_EVENT_INSTANT2("blink", "WebViewImpl::applyScrollAndScale::scrollB
y", "x", scrollDelta.width, "y", scrollDelta.height); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2559 m_layerTreeView->setVisible(visible); | 2540 m_layerTreeView->setVisible(visible); |
| 2560 } | 2541 } |
| 2561 } | 2542 } |
| 2562 | 2543 |
| 2563 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 2544 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 2564 { | 2545 { |
| 2565 return true; | 2546 return true; |
| 2566 } | 2547 } |
| 2567 | 2548 |
| 2568 } // namespace blink | 2549 } // namespace blink |
| OLD | NEW |