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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 #include "platform/KeyboardCodes.h" | 104 #include "platform/KeyboardCodes.h" |
105 #include "platform/Logging.h" | 105 #include "platform/Logging.h" |
106 #include "platform/PlatformGestureEvent.h" | 106 #include "platform/PlatformGestureEvent.h" |
107 #include "platform/PlatformKeyboardEvent.h" | 107 #include "platform/PlatformKeyboardEvent.h" |
108 #include "platform/PlatformMouseEvent.h" | 108 #include "platform/PlatformMouseEvent.h" |
109 #include "platform/RuntimeEnabledFeatures.h" | 109 #include "platform/RuntimeEnabledFeatures.h" |
110 #include "platform/TraceEvent.h" | 110 #include "platform/TraceEvent.h" |
111 #include "platform/UserGestureIndicator.h" | 111 #include "platform/UserGestureIndicator.h" |
112 #include "platform/exported/WebActiveGestureAnimation.h" | 112 #include "platform/exported/WebActiveGestureAnimation.h" |
113 #include "platform/fonts/FontCache.h" | 113 #include "platform/fonts/FontCache.h" |
| 114 #include "platform/geometry/FloatRect.h" |
114 #include "platform/graphics/Color.h" | 115 #include "platform/graphics/Color.h" |
115 #include "platform/graphics/CompositorMutatorClient.h" | 116 #include "platform/graphics/CompositorMutatorClient.h" |
116 #include "platform/graphics/FirstPaintInvalidationTracking.h" | 117 #include "platform/graphics/FirstPaintInvalidationTracking.h" |
117 #include "platform/graphics/GraphicsContext.h" | 118 #include "platform/graphics/GraphicsContext.h" |
118 #include "platform/graphics/Image.h" | 119 #include "platform/graphics/Image.h" |
119 #include "platform/graphics/ImageBuffer.h" | 120 #include "platform/graphics/ImageBuffer.h" |
120 #include "platform/graphics/gpu/DrawingBuffer.h" | 121 #include "platform/graphics/gpu/DrawingBuffer.h" |
121 #include "platform/graphics/paint/DrawingRecorder.h" | 122 #include "platform/graphics/paint/DrawingRecorder.h" |
122 #include "platform/image-decoders/ImageDecoder.h" | 123 #include "platform/image-decoders/ImageDecoder.h" |
123 #include "platform/scroll/ScrollbarTheme.h" | 124 #include "platform/scroll/ScrollbarTheme.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 , m_zoomFactorForDeviceScaleFactor(0.f) | 414 , m_zoomFactorForDeviceScaleFactor(0.f) |
414 , m_maximumLegibleScale(1) | 415 , m_maximumLegibleScale(1) |
415 , m_doubleTapZoomPageScaleFactor(0) | 416 , m_doubleTapZoomPageScaleFactor(0) |
416 , m_doubleTapZoomPending(false) | 417 , m_doubleTapZoomPending(false) |
417 , m_enableFakePageScaleAnimationForTesting(false) | 418 , m_enableFakePageScaleAnimationForTesting(false) |
418 , m_fakePageScaleAnimationPageScaleFactor(0) | 419 , m_fakePageScaleAnimationPageScaleFactor(0) |
419 , m_fakePageScaleAnimationUseAnchor(false) | 420 , m_fakePageScaleAnimationUseAnchor(false) |
420 , m_doingDragAndDrop(false) | 421 , m_doingDragAndDrop(false) |
421 , m_ignoreInputEvents(false) | 422 , m_ignoreInputEvents(false) |
422 , m_compositorDeviceScaleFactorOverride(0) | 423 , m_compositorDeviceScaleFactorOverride(0) |
423 , m_rootLayerScale(1) | |
424 , m_suppressNextKeypressEvent(false) | 424 , m_suppressNextKeypressEvent(false) |
425 , m_imeAcceptEvents(true) | 425 , m_imeAcceptEvents(true) |
426 , m_operationsAllowed(WebDragOperationNone) | 426 , m_operationsAllowed(WebDragOperationNone) |
427 , m_dragOperation(WebDragOperationNone) | 427 , m_dragOperation(WebDragOperationNone) |
428 , m_devToolsEmulator(nullptr) | 428 , m_devToolsEmulator(nullptr) |
429 , m_isTransparent(false) | 429 , m_isTransparent(false) |
430 , m_tabsToLinks(false) | 430 , m_tabsToLinks(false) |
431 , m_layerTreeView(nullptr) | 431 , m_layerTreeView(nullptr) |
432 , m_rootLayer(nullptr) | 432 , m_rootLayer(nullptr) |
433 , m_rootGraphicsLayer(nullptr) | 433 , m_rootGraphicsLayer(nullptr) |
(...skipping 3424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3858 return; | 3858 return; |
3859 m_compositorDeviceScaleFactorOverride = deviceScaleFactor; | 3859 m_compositorDeviceScaleFactorOverride = deviceScaleFactor; |
3860 if (m_zoomFactorForDeviceScaleFactor) { | 3860 if (m_zoomFactorForDeviceScaleFactor) { |
3861 setZoomLevel(zoomLevel()); | 3861 setZoomLevel(zoomLevel()); |
3862 return; | 3862 return; |
3863 } | 3863 } |
3864 if (page() && m_layerTreeView) | 3864 if (page() && m_layerTreeView) |
3865 updateLayerTreeDeviceScaleFactor(); | 3865 updateLayerTreeDeviceScaleFactor(); |
3866 } | 3866 } |
3867 | 3867 |
3868 void WebViewImpl::setRootLayerTransform(const WebSize& rootLayerOffset, float ro
otLayerScale) | 3868 void WebViewImpl::setRootLayerTransform(const TransformationMatrix& transform) |
3869 { | 3869 { |
3870 if (m_rootLayerScale == rootLayerScale && m_rootLayerOffset == rootLayerOffs
et) | 3870 if (transform == m_rootLayerTransform) |
3871 return; | 3871 return; |
3872 m_rootLayerScale = rootLayerScale; | 3872 m_rootLayerTransform = transform; |
3873 m_rootLayerOffset = rootLayerOffset; | |
3874 if (mainFrameImpl()) | |
3875 mainFrameImpl()->setInputEventsTransformForEmulation(m_rootLayerOffset,
m_rootLayerScale); | |
3876 updateRootLayerTransform(); | 3873 updateRootLayerTransform(); |
3877 } | 3874 } |
3878 | 3875 |
3879 void WebViewImpl::enableDeviceEmulation(const WebDeviceEmulationParams& params) | 3876 void WebViewImpl::enableDeviceEmulation(const WebDeviceEmulationParams& params) |
3880 { | 3877 { |
3881 m_devToolsEmulator->enableDeviceEmulation(params); | 3878 m_devToolsEmulator->enableDeviceEmulation(params); |
3882 } | 3879 } |
3883 | 3880 |
3884 void WebViewImpl::disableDeviceEmulation() | 3881 void WebViewImpl::disableDeviceEmulation() |
3885 { | 3882 { |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4103 void WebViewImpl::didChangeContentsSize() | 4100 void WebViewImpl::didChangeContentsSize() |
4104 { | 4101 { |
4105 pageScaleConstraintsSet().didChangeContentsSize(contentsSize(), pageScaleFac
tor()); | 4102 pageScaleConstraintsSet().didChangeContentsSize(contentsSize(), pageScaleFac
tor()); |
4106 } | 4103 } |
4107 | 4104 |
4108 void WebViewImpl::pageScaleFactorChanged() | 4105 void WebViewImpl::pageScaleFactorChanged() |
4109 { | 4106 { |
4110 pageScaleConstraintsSet().setNeedsReset(false); | 4107 pageScaleConstraintsSet().setNeedsReset(false); |
4111 updateLayerTreeViewport(); | 4108 updateLayerTreeViewport(); |
4112 m_client->pageScaleFactorChanged(); | 4109 m_client->pageScaleFactorChanged(); |
| 4110 m_devToolsEmulator->mainFrameScrollOrScaleChanged(); |
| 4111 } |
| 4112 |
| 4113 void WebViewImpl::mainFrameScrollOffsetChanged() |
| 4114 { |
| 4115 m_devToolsEmulator->mainFrameScrollOrScaleChanged(); |
4113 } | 4116 } |
4114 | 4117 |
4115 bool WebViewImpl::useExternalPopupMenus() | 4118 bool WebViewImpl::useExternalPopupMenus() |
4116 { | 4119 { |
4117 return shouldUseExternalPopupMenus; | 4120 return shouldUseExternalPopupMenus; |
4118 } | 4121 } |
4119 | 4122 |
4120 void WebViewImpl::startDragging(LocalFrame* frame, | 4123 void WebViewImpl::startDragging(LocalFrame* frame, |
4121 const WebDragData& dragData, | 4124 const WebDragData& dragData, |
4122 WebDragOperationsMask mask, | 4125 WebDragOperationsMask mask, |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4431 { | 4434 { |
4432 DCHECK(page()); | 4435 DCHECK(page()); |
4433 DCHECK(m_layerTreeView); | 4436 DCHECK(m_layerTreeView); |
4434 | 4437 |
4435 float deviceScaleFactor = m_compositorDeviceScaleFactorOverride ? m_composit
orDeviceScaleFactorOverride : page()->deviceScaleFactor(); | 4438 float deviceScaleFactor = m_compositorDeviceScaleFactorOverride ? m_composit
orDeviceScaleFactorOverride : page()->deviceScaleFactor(); |
4436 m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor); | 4439 m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor); |
4437 } | 4440 } |
4438 | 4441 |
4439 void WebViewImpl::updateRootLayerTransform() | 4442 void WebViewImpl::updateRootLayerTransform() |
4440 { | 4443 { |
4441 if (m_visualViewportContainerLayer) { | 4444 if (m_visualViewportContainerLayer) |
4442 TransformationMatrix transform; | 4445 m_visualViewportContainerLayer->setTransform(m_rootLayerTransform); |
4443 transform.translate(m_rootLayerOffset.width, m_rootLayerOffset.height); | |
4444 transform = transform.scale(m_rootLayerScale); | |
4445 m_visualViewportContainerLayer->setTransform(transform); | |
4446 } | |
4447 } | 4446 } |
4448 | 4447 |
4449 bool WebViewImpl::detectContentOnTouch(const GestureEventWithHitTestResults& tar
getedEvent) | 4448 bool WebViewImpl::detectContentOnTouch(const GestureEventWithHitTestResults& tar
getedEvent) |
4450 { | 4449 { |
4451 if (!m_page->mainFrame()->isLocalFrame()) | 4450 if (!m_page->mainFrame()->isLocalFrame()) |
4452 return false; | 4451 return false; |
4453 | 4452 |
4454 // Need a local copy of the hit test as setToShadowHostIfInUserAgentShadowRo
ot() will modify it. | 4453 // Need a local copy of the hit test as setToShadowHostIfInUserAgentShadowRo
ot() will modify it. |
4455 HitTestResult touchHit = targetedEvent.hitTestResult(); | 4454 HitTestResult touchHit = targetedEvent.hitTestResult(); |
4456 touchHit.setToShadowHostIfInUserAgentShadowRoot(); | 4455 touchHit.setToShadowHostIfInUserAgentShadowRoot(); |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4618 return nullptr; | 4617 return nullptr; |
4619 return focusedFrame; | 4618 return focusedFrame; |
4620 } | 4619 } |
4621 | 4620 |
4622 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const | 4621 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const |
4623 { | 4622 { |
4624 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4623 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
4625 } | 4624 } |
4626 | 4625 |
4627 } // namespace blink | 4626 } // namespace blink |
OLD | NEW |