| 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 2842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2853 | 2853 |
| 2854 void WebViewImpl::refreshPageScaleFactorAfterLayout() | 2854 void WebViewImpl::refreshPageScaleFactorAfterLayout() |
| 2855 { | 2855 { |
| 2856 if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()-
>view()) | 2856 if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()-
>view()) |
| 2857 return; | 2857 return; |
| 2858 FrameView* view = page()->mainFrame()->view(); | 2858 FrameView* view = page()->mainFrame()->view(); |
| 2859 | 2859 |
| 2860 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); | 2860 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); |
| 2861 m_pageScaleConstraintsSet.computeFinalConstraints(); | 2861 m_pageScaleConstraintsSet.computeFinalConstraints(); |
| 2862 | 2862 |
| 2863 if (settings()->shrinksViewportContentToFit() && settings()->viewportEnabled
() && !m_fixedLayoutSizeLock) { | 2863 if (settings()->shrinksViewportContentToFit() && !m_fixedLayoutSizeLock) { |
| 2864 int verticalScrollbarWidth = 0; | 2864 int verticalScrollbarWidth = 0; |
| 2865 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) | 2865 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) |
| 2866 verticalScrollbarWidth = view->verticalScrollbar()->width(); | 2866 verticalScrollbarWidth = view->verticalScrollbar()->width(); |
| 2867 m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(contentsS
ize(), verticalScrollbarWidth); | 2867 m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(contentsS
ize(), verticalScrollbarWidth); |
| 2868 } | 2868 } |
| 2869 | 2869 |
| 2870 if (pinchVirtualViewportEnabled()) | 2870 if (pinchVirtualViewportEnabled()) |
| 2871 mainFrameImpl()->frameView()->resize(m_pageScaleConstraintsSet.mainFrame
Size(contentsSize())); | 2871 mainFrameImpl()->frameView()->resize(m_pageScaleConstraintsSet.mainFrame
Size(contentsSize())); |
| 2872 | 2872 |
| 2873 float newPageScaleFactor = pageScaleFactor(); | 2873 float newPageScaleFactor = pageScaleFactor(); |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4064 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4064 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 4065 | 4065 |
| 4066 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4066 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 4067 return false; | 4067 return false; |
| 4068 | 4068 |
| 4069 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4069 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 4070 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4070 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 4071 } | 4071 } |
| 4072 | 4072 |
| 4073 } // namespace blink | 4073 } // namespace blink |
| OLD | NEW |