Chromium Code Reviews| 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 2951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2962 return; | 2962 return; |
| 2963 | 2963 |
| 2964 ViewportDescription adjustedDescription = description; | 2964 ViewportDescription adjustedDescription = description; |
| 2965 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { | 2965 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ e == ViewportDescription::ViewportMeta) { |
| 2966 if (adjustedDescription.maxWidth.type() == ExtendToZoom) | 2966 if (adjustedDescription.maxWidth.type() == ExtendToZoom) |
| 2967 adjustedDescription.maxWidth = Length(); // auto | 2967 adjustedDescription.maxWidth = Length(); // auto |
| 2968 adjustedDescription.minWidth = adjustedDescription.maxWidth; | 2968 adjustedDescription.minWidth = adjustedDescription.maxWidth; |
| 2969 adjustedDescription.minHeight = adjustedDescription.maxHeight; | 2969 adjustedDescription.minHeight = adjustedDescription.maxHeight; |
| 2970 } | 2970 } |
| 2971 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; | 2971 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; |
| 2972 float oldUserAgentInitialScale = m_pageScaleConstraintsSet.userAgentConstrai nts().initialScale; | |
| 2972 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); | 2973 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); |
| 2973 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode()); | 2974 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()->clobberUserAgentInitialScaleQuirk()); |
| 2974 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; | 2975 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; |
| 2975 if (oldInitialScale != newInitialScale && newInitialScale != -1) | 2976 if (oldInitialScale != newInitialScale && newInitialScale != -1) |
| 2976 m_pageScaleConstraintsSet.setNeedsReset(true); | 2977 m_pageScaleConstraintsSet.setNeedsReset(true); |
| 2977 | 2978 if (settingsImpl()->clobberUserAgentInitialScaleQuirk()) { |
|
aelias_OOO_until_Jul13
2013/11/01 00:10:07
Could you put all the logic within this block inst
mnaganov (inactive)
2013/11/04 17:20:52
Done.
| |
| 2979 float newUserAgentInitialScale = m_pageScaleConstraintsSet.userAgentCons traints().initialScale; | |
| 2980 if (oldUserAgentInitialScale != newUserAgentInitialScale) { | |
| 2981 m_pageScaleConstraintsSet.setNeedsReset(true); | |
| 2982 if (mainFrameImpl() && mainFrameImpl()->frameView()) | |
| 2983 mainFrameImpl()->frameView()->setNeedsLayout(); | |
| 2984 } | |
| 2985 } | |
| 2978 | 2986 |
| 2979 updateMainFrameLayoutSize(); | 2987 updateMainFrameLayoutSize(); |
| 2980 } | 2988 } |
| 2981 | 2989 |
| 2982 void WebViewImpl::updateMainFrameLayoutSize() | 2990 void WebViewImpl::updateMainFrameLayoutSize() |
| 2983 { | 2991 { |
| 2984 if (m_fixedLayoutSizeLock || !mainFrameImpl()) | 2992 if (m_fixedLayoutSizeLock || !mainFrameImpl()) |
| 2985 return; | 2993 return; |
| 2986 | 2994 |
| 2987 FrameView* view = mainFrameImpl()->frameView(); | 2995 FrameView* view = mainFrameImpl()->frameView(); |
| (...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4130 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); | 4138 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); |
| 4131 | 4139 |
| 4132 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4140 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4133 return false; | 4141 return false; |
| 4134 | 4142 |
| 4135 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4143 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4136 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); | 4144 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); |
| 4137 } | 4145 } |
| 4138 | 4146 |
| 4139 } // namespace WebKit | 4147 } // namespace WebKit |
| OLD | NEW |