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 1679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1690 FrameView* view = mainFrameImpl()->frameView(); | 1690 FrameView* view = mainFrameImpl()->frameView(); |
1691 if (!view) | 1691 if (!view) |
1692 return; | 1692 return; |
1693 | 1693 |
1694 WebSize oldSize = m_size; | 1694 WebSize oldSize = m_size; |
1695 float oldPageScaleFactor = pageScaleFactor(); | 1695 float oldPageScaleFactor = pageScaleFactor(); |
1696 int oldContentsWidth = contentsSize().width(); | 1696 int oldContentsWidth = contentsSize().width(); |
1697 | 1697 |
1698 m_size = newSize; | 1698 m_size = newSize; |
1699 | 1699 |
1700 bool shouldAnchorAndRescaleViewport = settings()->viewportEnabled() && oldSi
ze.width && oldContentsWidth && newSize.width != oldSize.width; | 1700 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta
tionChanges() |
| 1701 && oldSize.width && oldContentsWidth && newSize.width != oldSize.width; |
| 1702 |
1701 ViewportAnchor viewportAnchor(&mainFrameImpl()->frame()->eventHandler()); | 1703 ViewportAnchor viewportAnchor(&mainFrameImpl()->frame()->eventHandler()); |
1702 if (shouldAnchorAndRescaleViewport) { | 1704 if (shouldAnchorAndRescaleViewport) { |
1703 viewportAnchor.setAnchor(view->visibleContentRect(), | 1705 viewportAnchor.setAnchor(view->visibleContentRect(), |
1704 FloatSize(viewportAnchorXCoord, viewportAnchorY
Coord)); | 1706 FloatSize(viewportAnchorXCoord, viewportAnchorY
Coord)); |
1705 } | 1707 } |
1706 | 1708 |
1707 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); | 1709 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v
iewportDescription()); |
1708 updateMainFrameLayoutSize(); | 1710 updateMainFrameLayoutSize(); |
1709 | 1711 |
1710 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); | 1712 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); |
(...skipping 2466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4177 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4179 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4178 | 4180 |
4179 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4181 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4180 return false; | 4182 return false; |
4181 | 4183 |
4182 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4184 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4183 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4185 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4184 } | 4186 } |
4185 | 4187 |
4186 } // namespace WebKit | 4188 } // namespace WebKit |
OLD | NEW |