Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(795)

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 40423003: Experimental viewport meta tag support for desktop, Blink-side. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase again Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/web/WebSettingsImpl.cpp ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698