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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 #include "core/page/DragSession.h" | 106 #include "core/page/DragSession.h" |
107 #include "core/page/EventHandler.h" | 107 #include "core/page/EventHandler.h" |
108 #include "core/page/FocusController.h" | 108 #include "core/page/FocusController.h" |
109 #include "core/page/FrameTree.h" | 109 #include "core/page/FrameTree.h" |
110 #include "core/page/InjectedStyleSheets.h" | 110 #include "core/page/InjectedStyleSheets.h" |
111 #include "core/page/Page.h" | 111 #include "core/page/Page.h" |
112 #include "core/page/PagePopupClient.h" | 112 #include "core/page/PagePopupClient.h" |
113 #include "core/page/PointerLockController.h" | 113 #include "core/page/PointerLockController.h" |
114 #include "core/page/ScopedPageLoadDeferrer.h" | 114 #include "core/page/ScopedPageLoadDeferrer.h" |
115 #include "core/page/TouchDisambiguation.h" | 115 #include "core/page/TouchDisambiguation.h" |
116 #include "core/rendering/FastTextAutosizer.h" | |
117 #include "core/rendering/RenderView.h" | 116 #include "core/rendering/RenderView.h" |
118 #include "core/rendering/RenderWidget.h" | 117 #include "core/rendering/RenderWidget.h" |
119 #include "core/rendering/TextAutosizer.h" | 118 #include "core/rendering/TextAutosizer.h" |
120 #include "core/rendering/compositing/RenderLayerCompositor.h" | 119 #include "core/rendering/compositing/RenderLayerCompositor.h" |
121 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" | 120 #include "modules/device_orientation/DeviceOrientationInspectorAgent.h" |
122 #include "modules/encryptedmedia/MediaKeysController.h" | 121 #include "modules/encryptedmedia/MediaKeysController.h" |
123 #include "modules/geolocation/GeolocationController.h" | 122 #include "modules/geolocation/GeolocationController.h" |
124 #include "modules/indexeddb/InspectorIndexedDBAgent.h" | 123 #include "modules/indexeddb/InspectorIndexedDBAgent.h" |
125 #include "modules/notifications/NotificationController.h" | 124 #include "modules/notifications/NotificationController.h" |
126 #include "painting/ContinuousPainter.h" | 125 #include "painting/ContinuousPainter.h" |
(...skipping 2730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2857 } | 2856 } |
2858 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription,
m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings
Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir
kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve
rviewMode(), settingsImpl()->viewportMetaNonUserScalableQuirk()); | 2857 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription,
m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings
Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir
kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve
rviewMode(), settingsImpl()->viewportMetaNonUserScalableQuirk()); |
2859 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i
nitialScale; | 2858 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i
nitialScale; |
2860 if (oldInitialScale != newInitialScale && newInitialScale != -1) { | 2859 if (oldInitialScale != newInitialScale && newInitialScale != -1) { |
2861 m_pageScaleConstraintsSet.setNeedsReset(true); | 2860 m_pageScaleConstraintsSet.setNeedsReset(true); |
2862 if (mainFrameImpl() && mainFrameImpl()->frameView()) | 2861 if (mainFrameImpl() && mainFrameImpl()->frameView()) |
2863 mainFrameImpl()->frameView()->setNeedsLayout(); | 2862 mainFrameImpl()->frameView()->setNeedsLayout(); |
2864 } | 2863 } |
2865 | 2864 |
2866 updateMainFrameLayoutSize(); | 2865 updateMainFrameLayoutSize(); |
2867 | |
2868 if (LocalFrame* frame = page()->mainFrame()) { | |
2869 if (FastTextAutosizer* textAutosizer = frame->document()->fastTextAutosi
zer()) | |
2870 textAutosizer->updatePageInfoInAllFrames(); | |
2871 } | |
2872 } | 2866 } |
2873 | 2867 |
2874 void WebViewImpl::updateMainFrameLayoutSize() | 2868 void WebViewImpl::updateMainFrameLayoutSize() |
2875 { | 2869 { |
2876 if (m_fixedLayoutSizeLock || !mainFrameImpl()) | 2870 if (m_fixedLayoutSizeLock || !mainFrameImpl()) |
2877 return; | 2871 return; |
2878 | 2872 |
2879 RefPtr<FrameView> view = mainFrameImpl()->frameView(); | 2873 RefPtr<FrameView> view = mainFrameImpl()->frameView(); |
2880 if (!view) | 2874 if (!view) |
2881 return; | 2875 return; |
2882 | 2876 |
2883 WebSize layoutSize = m_size; | 2877 WebSize layoutSize = m_size; |
2884 | 2878 |
2885 if (settings()->viewportEnabled()) { | 2879 if (settings()->viewportEnabled()) { |
2886 layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstra
ints().layoutSize); | 2880 layoutSize = flooredIntSize(m_pageScaleConstraintsSet.pageDefinedConstra
ints().layoutSize); |
2887 | 2881 |
2888 bool textAutosizingEnabled = page()->settings().textAutosizingEnabled(); | 2882 bool textAutosizingEnabled = page()->settings().textAutosizingEnabled(); |
2889 if (textAutosizingEnabled && layoutSize.width != view->layoutSize().widt
h()) { | 2883 if (textAutosizingEnabled && layoutSize.width != view->layoutSize().widt
h()) { |
2890 if (TextAutosizer* textAutosizer = page()->mainFrame()->document()->
textAutosizer()) | 2884 TextAutosizer* textAutosizer = page()->mainFrame()->document()->text
Autosizer(); |
| 2885 if (textAutosizer) |
2891 textAutosizer->recalculateMultipliers(); | 2886 textAutosizer->recalculateMultipliers(); |
2892 } | 2887 } |
2893 } | 2888 } |
2894 | 2889 |
2895 view->setLayoutSize(layoutSize); | 2890 view->setLayoutSize(layoutSize); |
2896 } | 2891 } |
2897 | 2892 |
2898 IntSize WebViewImpl::contentsSize() const | 2893 IntSize WebViewImpl::contentsSize() const |
2899 { | 2894 { |
2900 RenderView* root = page()->mainFrame()->contentRenderer(); | 2895 RenderView* root = page()->mainFrame()->contentRenderer(); |
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3995 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3990 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
3996 | 3991 |
3997 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3992 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
3998 return false; | 3993 return false; |
3999 | 3994 |
4000 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 3995 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4001 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 3996 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4002 } | 3997 } |
4003 | 3998 |
4004 } // namespace blink | 3999 } // namespace blink |
OLD | NEW |