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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1688 FrameView* view = mainFrameImpl()->frameView(); | 1688 FrameView* view = mainFrameImpl()->frameView(); |
1689 if (!view) | 1689 if (!view) |
1690 return; | 1690 return; |
1691 | 1691 |
1692 WebSize oldSize = m_size; | 1692 WebSize oldSize = m_size; |
1693 float oldPageScaleFactor = pageScaleFactor(); | 1693 float oldPageScaleFactor = pageScaleFactor(); |
1694 int oldContentsWidth = contentsSize().width(); | 1694 int oldContentsWidth = contentsSize().width(); |
1695 | 1695 |
1696 m_size = newSize; | 1696 m_size = newSize; |
1697 | 1697 |
1698 bool shouldAnchorAndRescaleViewport = settings()->viewportEnabled() && oldSi
ze.width && oldContentsWidth && newSize.width != oldSize.width; | 1698 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta
tionChanges() |
| 1699 && oldSize.width && oldContentsWidth && newSize.width != oldSize.width; |
| 1700 |
1699 ViewportAnchor viewportAnchor(&mainFrameImpl()->frame()->eventHandler()); | 1701 ViewportAnchor viewportAnchor(&mainFrameImpl()->frame()->eventHandler()); |
1700 if (shouldAnchorAndRescaleViewport) { | 1702 if (shouldAnchorAndRescaleViewport) { |
1701 viewportAnchor.setAnchor(view->visibleContentRect(), | 1703 viewportAnchor.setAnchor(view->visibleContentRect(), |
1702 FloatSize(viewportAnchorXCoord, viewportAnchorY
Coord)); | 1704 FloatSize(viewportAnchorXCoord, viewportAnchorY
Coord)); |
1703 } | 1705 } |
1704 | 1706 |
1705 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); | 1707 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); |
1706 updateMainFrameLayoutSize(); | 1708 updateMainFrameLayoutSize(); |
1707 | 1709 |
1708 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); | 1710 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); |
(...skipping 2403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4112 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4114 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4113 | 4115 |
4114 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4116 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4115 return false; | 4117 return false; |
4116 | 4118 |
4117 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4119 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4118 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4120 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4119 } | 4121 } |
4120 | 4122 |
4121 } // namespace WebKit | 4123 } // namespace WebKit |
OLD | NEW |