| 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 3234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3245 } | 3245 } |
| 3246 | 3246 |
| 3247 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) | 3247 void WebViewImpl::updatePageDefinedViewportConstraints(const ViewportDescription
& description) |
| 3248 { | 3248 { |
| 3249 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight) || !page()->mainFrame()->isLocalFrame()) | 3249 if (!settings()->viewportEnabled() || !page() || (!m_size.width && !m_size.h
eight) || !page()->mainFrame()->isLocalFrame()) |
| 3250 return; | 3250 return; |
| 3251 | 3251 |
| 3252 Document* document = page()->deprecatedLocalMainFrame()->document(); | 3252 Document* document = page()->deprecatedLocalMainFrame()->document(); |
| 3253 | 3253 |
| 3254 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length(Devi
ceWidth) | 3254 m_matchesHeuristicsForGpuRasterization = description.maxWidth == Length(Devi
ceWidth) |
| 3255 && ((description.minZoom >= 1.0 && description.minZoomIsExplicit) | 3255 && description.minZoom == 1.0 |
| 3256 || !description.userZoom); | 3256 && description.minZoomIsExplicit; |
| 3257 if (m_layerTreeView) | 3257 if (m_layerTreeView) |
| 3258 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); | 3258 m_layerTreeView->heuristicsForGpuRasterizationUpdated(m_matchesHeuristic
sForGpuRasterization); |
| 3259 | 3259 |
| 3260 Length defaultMinWidth = document->viewportDefaultMinWidth(); | 3260 Length defaultMinWidth = document->viewportDefaultMinWidth(); |
| 3261 if (defaultMinWidth.isAuto()) | 3261 if (defaultMinWidth.isAuto()) |
| 3262 defaultMinWidth = Length(ExtendToZoom); | 3262 defaultMinWidth = Length(ExtendToZoom); |
| 3263 | 3263 |
| 3264 ViewportDescription adjustedDescription = description; | 3264 ViewportDescription adjustedDescription = description; |
| 3265 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { | 3265 if (settingsImpl()->viewportMetaLayoutSizeQuirk() && adjustedDescription.typ
e == ViewportDescription::ViewportMeta) { |
| 3266 const int legacyWidthSnappingMagicNumber = 320; | 3266 const int legacyWidthSnappingMagicNumber = 320; |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4466 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4466 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4467 | 4467 |
| 4468 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4468 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4469 return false; | 4469 return false; |
| 4470 | 4470 |
| 4471 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4471 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4472 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4472 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4473 } | 4473 } |
| 4474 | 4474 |
| 4475 } // namespace blink | 4475 } // namespace blink |
| OLD | NEW |