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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 #include "wtf/TemporaryChange.h" | 161 #include "wtf/TemporaryChange.h" |
162 | 162 |
163 #if USE(DEFAULT_RENDER_THEME) | 163 #if USE(DEFAULT_RENDER_THEME) |
164 #include "core/rendering/RenderThemeChromiumDefault.h" | 164 #include "core/rendering/RenderThemeChromiumDefault.h" |
165 #endif | 165 #endif |
166 | 166 |
167 // Get rid of WTF's pow define so we can use std::pow. | 167 // Get rid of WTF's pow define so we can use std::pow. |
168 #undef pow | 168 #undef pow |
169 #include <cmath> // for std::pow | 169 #include <cmath> // for std::pow |
170 | 170 |
171 using namespace WebCore; | 171 using namespace blink; |
172 | 172 |
173 // The following constants control parameters for automated scaling of webpages | 173 // The following constants control parameters for automated scaling of webpages |
174 // (such as due to a double tap gesture or find in page etc.). These are | 174 // (such as due to a double tap gesture or find in page etc.). These are |
175 // experimentally determined. | 175 // experimentally determined. |
176 static const int touchPointPadding = 32; | 176 static const int touchPointPadding = 32; |
177 static const int nonUserInitiatedPointPadding = 11; | 177 static const int nonUserInitiatedPointPadding = 11; |
178 static const float minScaleDifference = 0.01f; | 178 static const float minScaleDifference = 0.01f; |
179 static const float doubleTapZoomContentDefaultMargin = 5; | 179 static const float doubleTapZoomContentDefaultMargin = 5; |
180 static const float doubleTapZoomContentMinimumMargin = 2; | 180 static const float doubleTapZoomContentMinimumMargin = 2; |
181 static const double doubleTapZoomAnimationDurationInSeconds = 0.25; | 181 static const double doubleTapZoomAnimationDurationInSeconds = 0.25; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove); | 225 COMPILE_ASSERT_MATCHING_ENUM(DragOperationMove); |
226 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete); | 226 COMPILE_ASSERT_MATCHING_ENUM(DragOperationDelete); |
227 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); | 227 COMPILE_ASSERT_MATCHING_ENUM(DragOperationEvery); |
228 | 228 |
229 static bool shouldUseExternalPopupMenus = false; | 229 static bool shouldUseExternalPopupMenus = false; |
230 | 230 |
231 static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyStat
e) | 231 static int webInputEventKeyStateToPlatformEventKeyState(int webInputEventKeyStat
e) |
232 { | 232 { |
233 int platformEventKeyState = 0; | 233 int platformEventKeyState = 0; |
234 if (webInputEventKeyState & WebInputEvent::ShiftKey) | 234 if (webInputEventKeyState & WebInputEvent::ShiftKey) |
235 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::
ShiftKey; | 235 platformEventKeyState = platformEventKeyState | blink::PlatformEvent::Sh
iftKey; |
236 if (webInputEventKeyState & WebInputEvent::ControlKey) | 236 if (webInputEventKeyState & WebInputEvent::ControlKey) |
237 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::
CtrlKey; | 237 platformEventKeyState = platformEventKeyState | blink::PlatformEvent::Ct
rlKey; |
238 if (webInputEventKeyState & WebInputEvent::AltKey) | 238 if (webInputEventKeyState & WebInputEvent::AltKey) |
239 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::
AltKey; | 239 platformEventKeyState = platformEventKeyState | blink::PlatformEvent::Al
tKey; |
240 if (webInputEventKeyState & WebInputEvent::MetaKey) | 240 if (webInputEventKeyState & WebInputEvent::MetaKey) |
241 platformEventKeyState = platformEventKeyState | WebCore::PlatformEvent::
MetaKey; | 241 platformEventKeyState = platformEventKeyState | blink::PlatformEvent::Me
taKey; |
242 return platformEventKeyState; | 242 return platformEventKeyState; |
243 } | 243 } |
244 | 244 |
245 namespace { | 245 namespace { |
246 | 246 |
247 class UserGestureNotifier { | 247 class UserGestureNotifier { |
248 public: | 248 public: |
249 // If a UserGestureIndicator is created for a user gesture during the | 249 // If a UserGestureIndicator is created for a user gesture during the |
250 // lifetime of a UserGestureNotifier and *userGestureObserved is false, | 250 // lifetime of a UserGestureNotifier and *userGestureObserved is false, |
251 // the object will notify the client and set *userGestureObserved to true. | 251 // the object will notify the client and set *userGestureObserved to true. |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEve
nt& event) | 584 bool WebViewImpl::handleMouseWheel(LocalFrame& mainFrame, const WebMouseWheelEve
nt& event) |
585 { | 585 { |
586 hidePopups(); | 586 hidePopups(); |
587 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); | 587 return PageWidgetEventHandler::handleMouseWheel(mainFrame, event); |
588 } | 588 } |
589 | 589 |
590 bool WebViewImpl::scrollBy(const WebFloatSize& delta, const WebFloatSize& veloci
ty) | 590 bool WebViewImpl::scrollBy(const WebFloatSize& delta, const WebFloatSize& veloci
ty) |
591 { | 591 { |
592 if (m_flingSourceDevice == WebGestureDeviceTouchpad) { | 592 if (m_flingSourceDevice == WebGestureDeviceTouchpad) { |
593 WebMouseWheelEvent syntheticWheel; | 593 WebMouseWheelEvent syntheticWheel; |
594 const float tickDivisor = WebCore::WheelEvent::TickMultiplier; | 594 const float tickDivisor = blink::WheelEvent::TickMultiplier; |
595 | 595 |
596 syntheticWheel.deltaX = delta.width; | 596 syntheticWheel.deltaX = delta.width; |
597 syntheticWheel.deltaY = delta.height; | 597 syntheticWheel.deltaY = delta.height; |
598 syntheticWheel.wheelTicksX = delta.width / tickDivisor; | 598 syntheticWheel.wheelTicksX = delta.width / tickDivisor; |
599 syntheticWheel.wheelTicksY = delta.height / tickDivisor; | 599 syntheticWheel.wheelTicksY = delta.height / tickDivisor; |
600 syntheticWheel.hasPreciseScrollingDeltas = true; | 600 syntheticWheel.hasPreciseScrollingDeltas = true; |
601 syntheticWheel.x = m_positionOnFlingStart.x; | 601 syntheticWheel.x = m_positionOnFlingStart.x; |
602 syntheticWheel.y = m_positionOnFlingStart.y; | 602 syntheticWheel.y = m_positionOnFlingStart.y; |
603 syntheticWheel.globalX = m_globalPositionOnFlingStart.x; | 603 syntheticWheel.globalX = m_globalPositionOnFlingStart.x; |
604 syntheticWheel.globalY = m_globalPositionOnFlingStart.y; | 604 syntheticWheel.globalY = m_globalPositionOnFlingStart.y; |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 if (!mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) | 1427 if (!mapKeyCodeForScroll(keyCode, &scrollDirection, &scrollGranularity)) |
1428 return false; | 1428 return false; |
1429 | 1429 |
1430 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); | 1430 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); |
1431 if (!frame) | 1431 if (!frame) |
1432 return false; | 1432 return false; |
1433 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari
ty); | 1433 return frame->eventHandler().bubblingScroll(scrollDirection, scrollGranulari
ty); |
1434 } | 1434 } |
1435 | 1435 |
1436 bool WebViewImpl::mapKeyCodeForScroll(int keyCode, | 1436 bool WebViewImpl::mapKeyCodeForScroll(int keyCode, |
1437 WebCore::ScrollDirection* scrollDirection, | 1437 blink::ScrollDirection* scrollDirection, |
1438 WebCore::ScrollGranularity* scrollGranular
ity) | 1438 blink::ScrollGranularity* scrollGranularit
y) |
1439 { | 1439 { |
1440 switch (keyCode) { | 1440 switch (keyCode) { |
1441 case VKEY_LEFT: | 1441 case VKEY_LEFT: |
1442 *scrollDirection = ScrollLeft; | 1442 *scrollDirection = ScrollLeft; |
1443 *scrollGranularity = ScrollByLine; | 1443 *scrollGranularity = ScrollByLine; |
1444 break; | 1444 break; |
1445 case VKEY_RIGHT: | 1445 case VKEY_RIGHT: |
1446 *scrollDirection = ScrollRight; | 1446 *scrollDirection = ScrollRight; |
1447 *scrollGranularity = ScrollByLine; | 1447 *scrollGranularity = ScrollByLine; |
1448 break; | 1448 break; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1591 page()->frameHost().pinchViewport().setSize(newSize); | 1591 page()->frameHost().pinchViewport().setSize(newSize); |
1592 } | 1592 } |
1593 | 1593 |
1594 WebLocalFrameImpl* WebViewImpl::localFrameRootTemporary() const | 1594 WebLocalFrameImpl* WebViewImpl::localFrameRootTemporary() const |
1595 { | 1595 { |
1596 // FIXME: This is a temporary method that finds the first localFrame in a tr
aversal. | 1596 // FIXME: This is a temporary method that finds the first localFrame in a tr
aversal. |
1597 // This is equivalent to mainFrame() if the mainFrame is in-process. We need
to create | 1597 // This is equivalent to mainFrame() if the mainFrame is in-process. We need
to create |
1598 // separate WebWidgets to be created by RenderWidgets, which are associated
with *all* | 1598 // separate WebWidgets to be created by RenderWidgets, which are associated
with *all* |
1599 // local frame roots, not just the first one in the tree. Until then, this l
imits us | 1599 // local frame roots, not just the first one in the tree. Until then, this l
imits us |
1600 // to having only one functioning connected LocalFrame subtree per process. | 1600 // to having only one functioning connected LocalFrame subtree per process. |
1601 for (WebCore::Frame* frame = page()->mainFrame(); frame; frame = frame->tree
().traverseNext()) { | 1601 for (blink::Frame* frame = page()->mainFrame(); frame; frame = frame->tree()
.traverseNext()) { |
1602 if (frame->isLocalRoot()) | 1602 if (frame->isLocalRoot()) |
1603 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); | 1603 return WebLocalFrameImpl::fromFrame(toLocalFrame(frame)); |
1604 } | 1604 } |
1605 return 0; | 1605 return 0; |
1606 } | 1606 } |
1607 | 1607 |
1608 void WebViewImpl::performResize() | 1608 void WebViewImpl::performResize() |
1609 { | 1609 { |
1610 m_pageScaleConstraintsSet.didChangeViewSize(m_size); | 1610 m_pageScaleConstraintsSet.didChangeViewSize(m_size); |
1611 | 1611 |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1825 if (!page()) | 1825 if (!page()) |
1826 return; | 1826 return; |
1827 if (!page()->mainFrame()->isLocalFrame()) | 1827 if (!page()->mainFrame()->isLocalFrame()) |
1828 return; | 1828 return; |
1829 FrameView* view = page()->deprecatedLocalMainFrame()->view(); | 1829 FrameView* view = page()->deprecatedLocalMainFrame()->view(); |
1830 | 1830 |
1831 WebRect damagedRect(0, 0, m_size.width, m_size.height); | 1831 WebRect damagedRect(0, 0, m_size.width, m_size.height); |
1832 view->invalidateRect(damagedRect); | 1832 view->invalidateRect(damagedRect); |
1833 } | 1833 } |
1834 | 1834 |
1835 void WebViewImpl::enterFullScreenForElement(WebCore::Element* element) | 1835 void WebViewImpl::enterFullScreenForElement(blink::Element* element) |
1836 { | 1836 { |
1837 m_fullscreenController->enterFullScreenForElement(element); | 1837 m_fullscreenController->enterFullScreenForElement(element); |
1838 } | 1838 } |
1839 | 1839 |
1840 void WebViewImpl::exitFullScreenForElement(WebCore::Element* element) | 1840 void WebViewImpl::exitFullScreenForElement(blink::Element* element) |
1841 { | 1841 { |
1842 m_fullscreenController->exitFullScreenForElement(element); | 1842 m_fullscreenController->exitFullScreenForElement(element); |
1843 } | 1843 } |
1844 | 1844 |
1845 void WebViewImpl::clearCompositedSelectionBounds() | 1845 void WebViewImpl::clearCompositedSelectionBounds() |
1846 { | 1846 { |
1847 if (m_layerTreeView) | 1847 if (m_layerTreeView) |
1848 m_layerTreeView->clearSelection(); | 1848 m_layerTreeView->clearSelection(); |
1849 } | 1849 } |
1850 | 1850 |
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3561 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse
dOrMainFrame())) | 3561 if (LocalFrame* focusedFrame = toLocalFrame(page()->focusController().focuse
dOrMainFrame())) |
3562 focusedFrame->eventHandler().sendContextMenuEventForKey(); | 3562 focusedFrame->eventHandler().sendContextMenuEventForKey(); |
3563 m_contextMenuAllowed = false; | 3563 m_contextMenuAllowed = false; |
3564 } | 3564 } |
3565 | 3565 |
3566 void WebViewImpl::getSmartClipData(WebRect rect, WebString& clipText, WebRect& c
lipRect) | 3566 void WebViewImpl::getSmartClipData(WebRect rect, WebString& clipText, WebRect& c
lipRect) |
3567 { | 3567 { |
3568 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); | 3568 LocalFrame* frame = toLocalFrame(focusedWebCoreFrame()); |
3569 if (!frame) | 3569 if (!frame) |
3570 return; | 3570 return; |
3571 SmartClipData clipData = WebCore::SmartClip(frame).dataForRect(rect); | 3571 SmartClipData clipData = blink::SmartClip(frame).dataForRect(rect); |
3572 clipText = clipData.clipData(); | 3572 clipText = clipData.clipData(); |
3573 clipRect = clipData.rect(); | 3573 clipRect = clipData.rect(); |
3574 } | 3574 } |
3575 | 3575 |
3576 void WebViewImpl::extractSmartClipData(WebRect rect, WebString& clipText, WebStr
ing& clipHtml, WebRect& clipRect) | 3576 void WebViewImpl::extractSmartClipData(WebRect rect, WebString& clipText, WebStr
ing& clipHtml, WebRect& clipRect) |
3577 { | 3577 { |
3578 LocalFrame* localFrame = toLocalFrame(focusedWebCoreFrame()); | 3578 LocalFrame* localFrame = toLocalFrame(focusedWebCoreFrame()); |
3579 if (!localFrame) | 3579 if (!localFrame) |
3580 return; | 3580 return; |
3581 SmartClipData clipData = WebCore::SmartClip(localFrame).dataForRect(rect); | 3581 SmartClipData clipData = blink::SmartClip(localFrame).dataForRect(rect); |
3582 clipText = clipData.clipData(); | 3582 clipText = clipData.clipData(); |
3583 clipRect = clipData.rect(); | 3583 clipRect = clipData.rect(); |
3584 | 3584 |
3585 WebLocalFrameImpl* frame = mainFrameImpl(); | 3585 WebLocalFrameImpl* frame = mainFrameImpl(); |
3586 if (!frame) | 3586 if (!frame) |
3587 return; | 3587 return; |
3588 WebPoint startPoint(rect.x, rect.y); | 3588 WebPoint startPoint(rect.x, rect.y); |
3589 WebPoint endPoint(rect.x + rect.width, rect.y + rect.height); | 3589 WebPoint endPoint(rect.x + rect.width, rect.y + rect.height); |
3590 VisiblePosition startVisiblePosition = frame->visiblePositionForWindowPoint(
startPoint); | 3590 VisiblePosition startVisiblePosition = frame->visiblePositionForWindowPoint(
startPoint); |
3591 VisiblePosition endVisiblePosition = frame->visiblePositionForWindowPoint(en
dPoint); | 3591 VisiblePosition endVisiblePosition = frame->visiblePositionForWindowPoint(en
dPoint); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3676 RenderTheme::theme().platformColorsDidChange(); | 3676 RenderTheme::theme().platformColorsDidChange(); |
3677 #endif | 3677 #endif |
3678 } | 3678 } |
3679 | 3679 |
3680 void WebView::injectStyleSheet(const WebString& sourceCode, const WebVector<WebS
tring>& patternsIn, WebView::StyleInjectionTarget injectIn) | 3680 void WebView::injectStyleSheet(const WebString& sourceCode, const WebVector<WebS
tring>& patternsIn, WebView::StyleInjectionTarget injectIn) |
3681 { | 3681 { |
3682 Vector<String> patterns; | 3682 Vector<String> patterns; |
3683 for (size_t i = 0; i < patternsIn.size(); ++i) | 3683 for (size_t i = 0; i < patternsIn.size(); ++i) |
3684 patterns.append(patternsIn[i]); | 3684 patterns.append(patternsIn[i]); |
3685 | 3685 |
3686 InjectedStyleSheets::instance().add(sourceCode, patterns, static_cast<WebCor
e::StyleInjectionTarget>(injectIn)); | 3686 InjectedStyleSheets::instance().add(sourceCode, patterns, static_cast<blink:
:StyleInjectionTarget>(injectIn)); |
3687 } | 3687 } |
3688 | 3688 |
3689 void WebView::removeInjectedStyleSheets() | 3689 void WebView::removeInjectedStyleSheets() |
3690 { | 3690 { |
3691 InjectedStyleSheets::instance().removeAll(); | 3691 InjectedStyleSheets::instance().removeAll(); |
3692 } | 3692 } |
3693 | 3693 |
3694 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
e) | 3694 void WebViewImpl::didCommitLoad(bool isNewNavigation, bool isNavigationWithinPag
e) |
3695 { | 3695 { |
3696 if (isNewNavigation && !isNavigationWithinPage) | 3696 if (isNewNavigation && !isNavigationWithinPage) |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3809 | 3809 |
3810 m_pageOverlays->add(overlay, zOrder); | 3810 m_pageOverlays->add(overlay, zOrder); |
3811 } | 3811 } |
3812 | 3812 |
3813 void WebViewImpl::removePageOverlay(WebPageOverlay* overlay) | 3813 void WebViewImpl::removePageOverlay(WebPageOverlay* overlay) |
3814 { | 3814 { |
3815 if (m_pageOverlays && m_pageOverlays->remove(overlay) && m_pageOverlays->emp
ty()) | 3815 if (m_pageOverlays && m_pageOverlays->remove(overlay) && m_pageOverlays->emp
ty()) |
3816 m_pageOverlays = nullptr; | 3816 m_pageOverlays = nullptr; |
3817 } | 3817 } |
3818 | 3818 |
3819 void WebViewImpl::setOverlayLayer(WebCore::GraphicsLayer* layer) | 3819 void WebViewImpl::setOverlayLayer(blink::GraphicsLayer* layer) |
3820 { | 3820 { |
3821 if (!m_rootGraphicsLayer) | 3821 if (!m_rootGraphicsLayer) |
3822 return; | 3822 return; |
3823 | 3823 |
3824 if (!m_page->mainFrame()->isLocalFrame()) | 3824 if (!m_page->mainFrame()->isLocalFrame()) |
3825 return; | 3825 return; |
3826 | 3826 |
3827 if (pinchVirtualViewportEnabled()) { | 3827 if (pinchVirtualViewportEnabled()) { |
3828 m_page->deprecatedLocalMainFrame()->view()->renderView()->compositor()->
setOverlayLayer(layer); | 3828 m_page->deprecatedLocalMainFrame()->view()->renderView()->compositor()->
setOverlayLayer(layer); |
3829 return; | 3829 return; |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3939 | 3939 |
3940 void WebViewImpl::invalidateRect(const IntRect& rect) | 3940 void WebViewImpl::invalidateRect(const IntRect& rect) |
3941 { | 3941 { |
3942 if (m_isAcceleratedCompositingActive) { | 3942 if (m_isAcceleratedCompositingActive) { |
3943 ASSERT(m_layerTreeView); | 3943 ASSERT(m_layerTreeView); |
3944 updateLayerTreeViewport(); | 3944 updateLayerTreeViewport(); |
3945 } else if (m_client) | 3945 } else if (m_client) |
3946 m_client->didInvalidateRect(rect); | 3946 m_client->didInvalidateRect(rect); |
3947 } | 3947 } |
3948 | 3948 |
3949 WebCore::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const | 3949 blink::GraphicsLayerFactory* WebViewImpl::graphicsLayerFactory() const |
3950 { | 3950 { |
3951 return m_graphicsLayerFactory.get(); | 3951 return m_graphicsLayerFactory.get(); |
3952 } | 3952 } |
3953 | 3953 |
3954 WebCore::RenderLayerCompositor* WebViewImpl::compositor() const | 3954 blink::RenderLayerCompositor* WebViewImpl::compositor() const |
3955 { | 3955 { |
3956 if (!page() || !page()->mainFrame()) | 3956 if (!page() || !page()->mainFrame()) |
3957 return 0; | 3957 return 0; |
3958 | 3958 |
3959 if (!page()->mainFrame()->isLocalFrame()) | 3959 if (!page()->mainFrame()->isLocalFrame()) |
3960 return localFrameRootTemporary()->frame()->document()->renderView()->com
positor(); | 3960 return localFrameRootTemporary()->frame()->document()->renderView()->com
positor(); |
3961 | 3961 |
3962 if (!page()->deprecatedLocalMainFrame()->document() || !page()->deprecatedLo
calMainFrame()->document()->renderView()) | 3962 if (!page()->deprecatedLocalMainFrame()->document() || !page()->deprecatedLo
calMainFrame()->document()->renderView()) |
3963 return 0; | 3963 return 0; |
3964 | 3964 |
3965 return page()->deprecatedLocalMainFrame()->document()->renderView()->composi
tor(); | 3965 return page()->deprecatedLocalMainFrame()->document()->renderView()->composi
tor(); |
3966 } | 3966 } |
3967 | 3967 |
3968 void WebViewImpl::registerForAnimations(WebLayer* layer) | 3968 void WebViewImpl::registerForAnimations(WebLayer* layer) |
3969 { | 3969 { |
3970 if (m_layerTreeView) | 3970 if (m_layerTreeView) |
3971 m_layerTreeView->registerForAnimations(layer); | 3971 m_layerTreeView->registerForAnimations(layer); |
3972 } | 3972 } |
3973 | 3973 |
3974 WebCore::GraphicsLayer* WebViewImpl::rootGraphicsLayer() | 3974 blink::GraphicsLayer* WebViewImpl::rootGraphicsLayer() |
3975 { | 3975 { |
3976 return m_rootGraphicsLayer; | 3976 return m_rootGraphicsLayer; |
3977 } | 3977 } |
3978 | 3978 |
3979 void WebViewImpl::scheduleAnimation() | 3979 void WebViewImpl::scheduleAnimation() |
3980 { | 3980 { |
3981 if (isAcceleratedCompositingActive()) { | 3981 if (isAcceleratedCompositingActive()) { |
3982 ASSERT(m_layerTreeView); | 3982 ASSERT(m_layerTreeView); |
3983 m_layerTreeView->setNeedsAnimate(); | 3983 m_layerTreeView->setNeedsAnimate(); |
3984 return; | 3984 return; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4143 // or update the transform layer. | 4143 // or update the transform layer. |
4144 if (!m_rootGraphicsLayer) | 4144 if (!m_rootGraphicsLayer) |
4145 return; | 4145 return; |
4146 | 4146 |
4147 // FIXME(bokan): m_rootTransformLayer is always set here in pinch virtual vi
ewport. This can go away once | 4147 // FIXME(bokan): m_rootTransformLayer is always set here in pinch virtual vi
ewport. This can go away once |
4148 // that's default everywhere. | 4148 // that's default everywhere. |
4149 if (!m_rootTransformLayer && m_page->mainFrame()->isLocalFrame()) | 4149 if (!m_rootTransformLayer && m_page->mainFrame()->isLocalFrame()) |
4150 m_rootTransformLayer = m_page->deprecatedLocalMainFrame()->view()->rende
rView()->compositor()->ensureRootTransformLayer(); | 4150 m_rootTransformLayer = m_page->deprecatedLocalMainFrame()->view()->rende
rView()->compositor()->ensureRootTransformLayer(); |
4151 | 4151 |
4152 if (m_rootTransformLayer) { | 4152 if (m_rootTransformLayer) { |
4153 WebCore::TransformationMatrix transform; | 4153 blink::TransformationMatrix transform; |
4154 transform.translate(m_rootLayerOffset.width, m_rootLayerOffset.height); | 4154 transform.translate(m_rootLayerOffset.width, m_rootLayerOffset.height); |
4155 transform = transform.scale(m_rootLayerScale); | 4155 transform = transform.scale(m_rootLayerScale); |
4156 m_rootTransformLayer->setTransform(transform); | 4156 m_rootTransformLayer->setTransform(transform); |
4157 } | 4157 } |
4158 } | 4158 } |
4159 | 4159 |
4160 bool WebViewImpl::detectContentOnTouch(const WebPoint& position) | 4160 bool WebViewImpl::detectContentOnTouch(const WebPoint& position) |
4161 { | 4161 { |
4162 HitTestResult touchHit = hitTestResultForWindowPos(position); | 4162 HitTestResult touchHit = hitTestResultForWindowPos(position); |
4163 | 4163 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4251 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4251 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4252 | 4252 |
4253 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4253 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4254 return false; | 4254 return false; |
4255 | 4255 |
4256 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4256 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4257 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4257 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4258 } | 4258 } |
4259 | 4259 |
4260 } // namespace blink | 4260 } // namespace blink |
OLD | NEW |