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

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: Android stylesheet and fixes 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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698