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 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2864 | 2864 |
| 2865 void WebViewImpl::setPageScaleFactor(float scaleFactor, const WebPoint& origin) | 2865 void WebViewImpl::setPageScaleFactor(float scaleFactor, const WebPoint& origin) |
| 2866 { | 2866 { |
| 2867 if (!page()) | 2867 if (!page()) |
| 2868 return; | 2868 return; |
| 2869 | 2869 |
| 2870 IntPoint newScrollOffset = origin; | 2870 IntPoint newScrollOffset = origin; |
| 2871 scaleFactor = clampPageScaleFactorToLimits(scaleFactor); | 2871 scaleFactor = clampPageScaleFactorToLimits(scaleFactor); |
| 2872 newScrollOffset = clampOffsetAtScale(newScrollOffset, scaleFactor); | 2872 newScrollOffset = clampOffsetAtScale(newScrollOffset, scaleFactor); |
| 2873 | 2873 |
| 2874 // Since we are about to explicitly set the page scale factor, this should | |
| 2875 // cancel out any outstanding reset request. | |
| 2876 m_pageScaleConstraintsSet.setNeedsReset(false); | |
|
aelias_OOO_until_Jul13
2013/07/02 22:59:33
This is a somewhat subtle initialization-timing ch
wjmaclean
2013/07/03 14:12:23
OK, but are we sure there's no way this "subtle ti
aelias_OOO_until_Jul13
2013/07/08 00:53:20
I don't currently know of a bug here, but it's pos
| |
| 2874 page()->setPageScaleFactor(scaleFactor, newScrollOffset); | 2877 page()->setPageScaleFactor(scaleFactor, newScrollOffset); |
| 2875 } | 2878 } |
| 2876 | 2879 |
| 2877 void WebViewImpl::setPageScaleFactorPreservingScrollOffset(float scaleFactor) | 2880 void WebViewImpl::setPageScaleFactorPreservingScrollOffset(float scaleFactor) |
| 2878 { | 2881 { |
| 2879 if (clampPageScaleFactorToLimits(scaleFactor) == pageScaleFactor()) | 2882 if (clampPageScaleFactorToLimits(scaleFactor) == pageScaleFactor()) |
| 2880 return; | 2883 return; |
| 2881 | 2884 |
| 2882 IntPoint scrollOffset(mainFrame()->scrollOffset().width, mainFrame()->scroll Offset().height); | 2885 IntPoint scrollOffset(mainFrame()->scrollOffset().width, mainFrame()->scroll Offset().height); |
| 2883 setPageScaleFactor(scaleFactor, scrollOffset); | 2886 setPageScaleFactor(scaleFactor, scrollOffset); |
| (...skipping 1240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4124 } | 4127 } |
| 4125 | 4128 |
| 4126 bool WebViewImpl::shouldDisableDesktopWorkarounds() | 4129 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4127 { | 4130 { |
| 4128 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); | 4131 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); |
| 4129 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom | 4132 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom |
| 4130 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); | 4133 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); |
| 4131 } | 4134 } |
| 4132 | 4135 |
| 4133 } // namespace WebKit | 4136 } // namespace WebKit |
| OLD | NEW |