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 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
403 , m_chromeClientImpl(ChromeClientImpl::create(this)) | 403 , m_chromeClientImpl(ChromeClientImpl::create(this)) |
404 , m_contextMenuClientImpl(this) | 404 , m_contextMenuClientImpl(this) |
405 , m_dragClientImpl(this) | 405 , m_dragClientImpl(this) |
406 , m_editorClientImpl(this) | 406 , m_editorClientImpl(this) |
407 , m_spellCheckerClientImpl(this) | 407 , m_spellCheckerClientImpl(this) |
408 , m_storageClientImpl(this) | 408 , m_storageClientImpl(this) |
409 , m_shouldAutoResize(false) | 409 , m_shouldAutoResize(false) |
410 , m_zoomLevel(0) | 410 , m_zoomLevel(0) |
411 , m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)) | 411 , m_minimumZoomLevel(zoomFactorToZoomLevel(minTextSizeMultiplier)) |
412 , m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)) | 412 , m_maximumZoomLevel(zoomFactorToZoomLevel(maxTextSizeMultiplier)) |
413 , m_zoomFactorForDeviceScaleFactor(1.f) | 413 , m_zoomFactorForDeviceScaleFactor(0.f) |
414 , m_maximumLegibleScale(1) | 414 , m_maximumLegibleScale(1) |
415 , m_doubleTapZoomPageScaleFactor(0) | 415 , m_doubleTapZoomPageScaleFactor(0) |
416 , m_doubleTapZoomPending(false) | 416 , m_doubleTapZoomPending(false) |
417 , m_enableFakePageScaleAnimationForTesting(false) | 417 , m_enableFakePageScaleAnimationForTesting(false) |
418 , m_fakePageScaleAnimationPageScaleFactor(0) | 418 , m_fakePageScaleAnimationPageScaleFactor(0) |
419 , m_fakePageScaleAnimationUseAnchor(false) | 419 , m_fakePageScaleAnimationUseAnchor(false) |
420 , m_doingDragAndDrop(false) | 420 , m_doingDragAndDrop(false) |
421 , m_ignoreInputEvents(false) | 421 , m_ignoreInputEvents(false) |
422 , m_compositorDeviceScaleFactorOverride(0) | 422 , m_compositorDeviceScaleFactorOverride(0) |
423 , m_rootLayerScale(1) | 423 , m_rootLayerScale(1) |
(...skipping 2624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3048 m_zoomLevel = zoomLevel; | 3048 m_zoomLevel = zoomLevel; |
3049 | 3049 |
3050 // TODO(nasko): Setting zoom level needs to be refactored to support | 3050 // TODO(nasko): Setting zoom level needs to be refactored to support |
3051 // out-of-process iframes. See https://crbug.com/528407. | 3051 // out-of-process iframes. See https://crbug.com/528407. |
3052 if (mainFrame()->isWebRemoteFrame()) | 3052 if (mainFrame()->isWebRemoteFrame()) |
3053 return m_zoomLevel; | 3053 return m_zoomLevel; |
3054 | 3054 |
3055 LocalFrame* frame = mainFrameImpl()->frame(); | 3055 LocalFrame* frame = mainFrameImpl()->frame(); |
3056 if (!WebLocalFrameImpl::pluginContainerFromFrame(frame)) { | 3056 if (!WebLocalFrameImpl::pluginContainerFromFrame(frame)) { |
3057 float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_
cast<float>(zoomLevelToZoomFactor(m_zoomLevel)); | 3057 float zoomFactor = m_zoomFactorOverride ? m_zoomFactorOverride : static_
cast<float>(zoomLevelToZoomFactor(m_zoomLevel)); |
3058 zoomFactor *= m_zoomFactorForDeviceScaleFactor; | 3058 if (m_zoomFactorForDeviceScaleFactor) { |
| 3059 if (m_compositorDeviceScaleFactorOverride) { |
| 3060 page()->setDeviceScaleFactor(m_zoomFactorForDeviceScaleFactor / m_co
mpositorDeviceScaleFactorOverride); |
| 3061 zoomFactor *= m_compositorDeviceScaleFactorOverride; |
| 3062 } else { |
| 3063 page()->setDeviceScaleFactor(1.f); |
| 3064 zoomFactor *= m_zoomFactorForDeviceScaleFactor; |
| 3065 } |
| 3066 } |
3059 frame->setPageZoomFactor(zoomFactor); | 3067 frame->setPageZoomFactor(zoomFactor); |
3060 } | 3068 } |
3061 | 3069 |
3062 return m_zoomLevel; | 3070 return m_zoomLevel; |
3063 } | 3071 } |
3064 | 3072 |
3065 void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel, | 3073 void WebViewImpl::zoomLimitsChanged(double minimumZoomLevel, |
3066 double maximumZoomLevel) | 3074 double maximumZoomLevel) |
3067 { | 3075 { |
3068 m_minimumZoomLevel = minimumZoomLevel; | 3076 m_minimumZoomLevel = minimumZoomLevel; |
(...skipping 696 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3765 unsigned long WebViewImpl::createUniqueIdentifierForRequest() | 3773 unsigned long WebViewImpl::createUniqueIdentifierForRequest() |
3766 { | 3774 { |
3767 return createUniqueIdentifier(); | 3775 return createUniqueIdentifier(); |
3768 } | 3776 } |
3769 | 3777 |
3770 void WebViewImpl::setCompositorDeviceScaleFactorOverride(float deviceScaleFactor
) | 3778 void WebViewImpl::setCompositorDeviceScaleFactorOverride(float deviceScaleFactor
) |
3771 { | 3779 { |
3772 if (m_compositorDeviceScaleFactorOverride == deviceScaleFactor) | 3780 if (m_compositorDeviceScaleFactorOverride == deviceScaleFactor) |
3773 return; | 3781 return; |
3774 m_compositorDeviceScaleFactorOverride = deviceScaleFactor; | 3782 m_compositorDeviceScaleFactorOverride = deviceScaleFactor; |
3775 if (page() && m_layerTreeView) | 3783 if (page() && m_layerTreeView) { |
| 3784 if (m_zoomFactorForDeviceScaleFactor) { |
| 3785 setZoomLevel(zoomLevel()); |
| 3786 return; |
| 3787 } |
3776 updateLayerTreeDeviceScaleFactor(); | 3788 updateLayerTreeDeviceScaleFactor(); |
| 3789 } |
3777 } | 3790 } |
3778 | 3791 |
3779 void WebViewImpl::setRootLayerTransform(const WebSize& rootLayerOffset, float ro
otLayerScale) | 3792 void WebViewImpl::setRootLayerTransform(const WebSize& rootLayerOffset, float ro
otLayerScale) |
3780 { | 3793 { |
3781 if (m_rootLayerScale == rootLayerScale && m_rootLayerOffset == rootLayerOffs
et) | 3794 if (m_rootLayerScale == rootLayerScale && m_rootLayerOffset == rootLayerOffs
et) |
3782 return; | 3795 return; |
3783 m_rootLayerScale = rootLayerScale; | 3796 m_rootLayerScale = rootLayerScale; |
3784 m_rootLayerOffset = rootLayerOffset; | 3797 m_rootLayerOffset = rootLayerOffset; |
3785 if (mainFrameImpl()) | 3798 if (mainFrameImpl()) |
3786 mainFrameImpl()->setInputEventsTransformForEmulation(m_rootLayerOffset,
m_rootLayerScale); | 3799 mainFrameImpl()->setInputEventsTransformForEmulation(m_rootLayerOffset,
m_rootLayerScale); |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4580 { | 4593 { |
4581 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than | 4594 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa
ctor rather than |
4582 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4595 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
4583 if (!page()) | 4596 if (!page()) |
4584 return 1; | 4597 return 1; |
4585 | 4598 |
4586 return page()->deviceScaleFactor(); | 4599 return page()->deviceScaleFactor(); |
4587 } | 4600 } |
4588 | 4601 |
4589 } // namespace blink | 4602 } // namespace blink |
OLD | NEW |