Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 53053002: [Android WebView] Add a legacy quirk for 'user-scalable=no' case (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Moved min/max scale reset under the quirk condition, rebased Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3002 matching lines...) Expand 10 before | Expand all | Expand 10 after
3013 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 3013 float oldInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
3014 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size); 3014 m_pageScaleConstraintsSet.updatePageDefinedConstraints(adjustedDescription, m_size);
3015 3015
3016 if (settingsImpl()->clobberUserAgentInitialScaleQuirk() 3016 if (settingsImpl()->clobberUserAgentInitialScaleQuirk()
3017 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1 3017 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale != -1
3018 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * devic eScaleFactor() <= 1) { 3018 && m_pageScaleConstraintsSet.userAgentConstraints().initialScale * devic eScaleFactor() <= 1) {
3019 if (!description.maxWidth.isFixed() 3019 if (!description.maxWidth.isFixed()
3020 || (description.maxWidth == Length(100, ViewportPercentageWidth) && m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale == 1.0f)) 3020 || (description.maxWidth == Length(100, ViewportPercentageWidth) && m_pageScaleConstraintsSet.pageDefinedConstraints().initialScale == 1.0f))
3021 setInitialPageScaleOverride(-1); 3021 setInitialPageScaleOverride(-1);
3022 } 3022 }
3023 m_pageScaleConstraintsSet.adjustForAndroidWebViewQuirks(adjustedDescription, m_size, page()->settings().layoutFallbackWidth(), deviceScaleFactor(), settings Impl()->supportDeprecatedTargetDensityDPI(), page()->settings().wideViewportQuir kEnabled(), page()->settings().useWideViewport(), page()->settings().loadWithOve rviewMode()); 3023 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());
3024 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale; 3024 float newInitialScale = m_pageScaleConstraintsSet.pageDefinedConstraints().i nitialScale;
3025 if (oldInitialScale != newInitialScale && newInitialScale != -1) { 3025 if (oldInitialScale != newInitialScale && newInitialScale != -1) {
3026 m_pageScaleConstraintsSet.setNeedsReset(true); 3026 m_pageScaleConstraintsSet.setNeedsReset(true);
3027 if (mainFrameImpl() && mainFrameImpl()->frameView()) 3027 if (mainFrameImpl() && mainFrameImpl()->frameView())
3028 mainFrameImpl()->frameView()->setNeedsLayout(); 3028 mainFrameImpl()->frameView()->setNeedsLayout();
3029 } 3029 }
3030 3030
3031 updateMainFrameLayoutSize(); 3031 updateMainFrameLayoutSize();
3032 } 3032 }
3033 3033
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4197 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4197 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4198 4198
4199 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4199 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4200 return false; 4200 return false;
4201 4201
4202 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4202 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4203 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4203 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4204 } 4204 }
4205 4205
4206 } // namespace WebKit 4206 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698