| 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 2764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2775 | 2775 |
| 2776 void WebViewImpl::refreshPageScaleFactorAfterLayout() | 2776 void WebViewImpl::refreshPageScaleFactorAfterLayout() |
| 2777 { | 2777 { |
| 2778 if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()-
>view()) | 2778 if (!mainFrame() || !page() || !page()->mainFrame() || !page()->mainFrame()-
>view()) |
| 2779 return; | 2779 return; |
| 2780 FrameView* view = page()->mainFrame()->view(); | 2780 FrameView* view = page()->mainFrame()->view(); |
| 2781 | 2781 |
| 2782 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); | 2782 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); |
| 2783 m_pageScaleConstraintsSet.computeFinalConstraints(); | 2783 m_pageScaleConstraintsSet.computeFinalConstraints(); |
| 2784 | 2784 |
| 2785 if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) { | 2785 if (!m_fixedLayoutSizeLock) { |
| 2786 int verticalScrollbarWidth = 0; | 2786 int verticalScrollbarWidth = 0; |
| 2787 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) | 2787 if (view->verticalScrollbar() && !view->verticalScrollbar()->isOverlaySc
rollbar()) |
| 2788 verticalScrollbarWidth = view->verticalScrollbar()->width(); | 2788 verticalScrollbarWidth = view->verticalScrollbar()->width(); |
| 2789 m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(m_size, c
ontentsSize(), verticalScrollbarWidth); | 2789 m_pageScaleConstraintsSet.adjustFinalConstraintsToContentsSize(m_size, c
ontentsSize(), verticalScrollbarWidth); |
| 2790 } | 2790 } |
| 2791 | 2791 |
| 2792 float newPageScaleFactor = pageScaleFactor(); | 2792 float newPageScaleFactor = pageScaleFactor(); |
| 2793 if (m_pageScaleConstraintsSet.needsReset() && m_pageScaleConstraintsSet.fina
lConstraints().initialScale != -1) { | 2793 if (m_pageScaleConstraintsSet.needsReset() && m_pageScaleConstraintsSet.fina
lConstraints().initialScale != -1) { |
| 2794 newPageScaleFactor = m_pageScaleConstraintsSet.finalConstraints().initia
lScale; | 2794 newPageScaleFactor = m_pageScaleConstraintsSet.finalConstraints().initia
lScale; |
| 2795 m_pageScaleConstraintsSet.setNeedsReset(false); | 2795 m_pageScaleConstraintsSet.setNeedsReset(false); |
| (...skipping 1172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3968 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 3968 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
| 3969 | 3969 |
| 3970 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 3970 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
| 3971 return false; | 3971 return false; |
| 3972 | 3972 |
| 3973 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 3973 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
| 3974 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 3974 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
| 3975 } | 3975 } |
| 3976 | 3976 |
| 3977 } // namespace blink | 3977 } // namespace blink |
| OLD | NEW |