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

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: 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
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 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 FrameView* view = mainFrameImpl()->frameView(); 1689 FrameView* view = mainFrameImpl()->frameView();
1690 if (!view) 1690 if (!view)
1691 return; 1691 return;
1692 1692
1693 WebSize oldSize = m_size; 1693 WebSize oldSize = m_size;
1694 float oldPageScaleFactor = pageScaleFactor(); 1694 float oldPageScaleFactor = pageScaleFactor();
1695 int oldContentsWidth = contentsSize().width(); 1695 int oldContentsWidth = contentsSize().width();
1696 1696
1697 m_size = newSize; 1697 m_size = newSize;
1698 1698
1699 bool shouldAnchorAndRescaleViewport = settings()->viewportEnabled() && oldSi ze.width && oldContentsWidth && newSize.width != oldSize.width; 1699 bool shouldAnchorAndRescaleViewport = settings()->mainFrameResizesAreOrienta tionChanges()
1700 && oldSize.width && oldContentsWidth && newSize.width != oldSize.width;
1701
1700 ViewportAnchor viewportAnchor(&mainFrameImpl()->frame()->eventHandler()); 1702 ViewportAnchor viewportAnchor(&mainFrameImpl()->frame()->eventHandler());
1701 if (shouldAnchorAndRescaleViewport) { 1703 if (shouldAnchorAndRescaleViewport) {
1702 viewportAnchor.setAnchor(view->visibleContentRect(), 1704 viewportAnchor.setAnchor(view->visibleContentRect(),
1703 FloatSize(viewportAnchorXCoord, viewportAnchorY Coord)); 1705 FloatSize(viewportAnchorXCoord, viewportAnchorY Coord));
1704 } 1706 }
1705 1707
1706 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v iewportDescription()); 1708 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document()->v iewportDescription());
1707 updateMainFrameLayoutSize(); 1709 updateMainFrameLayoutSize();
1708 1710
1709 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate(); 1711 WebDevToolsAgentPrivate* agentPrivate = devToolsAgentPrivate();
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after
4125 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4127 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4126 4128
4127 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4129 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4128 return false; 4130 return false;
4129 4131
4130 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4132 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4131 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4133 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4132 } 4134 }
4133 4135
4134 } // namespace WebKit 4136 } // namespace WebKit
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698