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

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

Issue 308003007: [DevTools] Update media queries when resizing with emulation on. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1612 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document( )->viewportDescription()); 1612 updatePageDefinedViewportConstraints(mainFrameImpl()->frame()->document( )->viewportDescription());
1613 updateMainFrameLayoutSize(); 1613 updateMainFrameLayoutSize();
1614 1614
1615 // If the virtual viewport pinch mode is enabled, the main frame will be resized 1615 // If the virtual viewport pinch mode is enabled, the main frame will be resized
1616 // after layout so it can be sized to the contentsSize. 1616 // after layout so it can be sized to the contentsSize.
1617 if (!pinchVirtualViewportEnabled() && mainFrameImpl()->frameView()) 1617 if (!pinchVirtualViewportEnabled() && mainFrameImpl()->frameView())
1618 mainFrameImpl()->frameView()->resize(m_size); 1618 mainFrameImpl()->frameView()->resize(m_size);
1619 1619
1620 if (pinchVirtualViewportEnabled()) 1620 if (pinchVirtualViewportEnabled())
1621 page()->frameHost().pinchViewport().setSize(m_size); 1621 page()->frameHost().pinchViewport().setSize(m_size);
1622
1623 if (page()->inspectorController().deviceEmulationEnabled() && mainFrameI mpl()->frame()->document())
apavlov 2014/05/30 14:13:53 Not sure if it is worth it, but in our instrumenta
ojan 2014/05/31 05:32:39 +1. We don't have an official style rule around th
dgozman 2014/06/03 12:09:15 Done.
1624 mainFrameImpl()->frame()->document()->mediaQueryAffectingValueChange d();
1622 } 1625 }
1623 1626
1624 if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) { 1627 if (settings()->viewportEnabled() && !m_fixedLayoutSizeLock) {
1625 // Relayout immediately to recalculate the minimum scale limit. 1628 // Relayout immediately to recalculate the minimum scale limit.
1626 if (view->needsLayout()) 1629 if (view->needsLayout())
1627 view->layout(); 1630 view->layout();
1628 1631
1629 if (shouldAnchorAndRescaleViewport) { 1632 if (shouldAnchorAndRescaleViewport) {
1630 float viewportWidthRatio = static_cast<float>(newSize.width) / oldSi ze.width; 1633 float viewportWidthRatio = static_cast<float>(newSize.width) / oldSi ze.width;
1631 float contentsWidthRatio = static_cast<float>(contentsSize().width() ) / oldContentsWidth; 1634 float contentsWidthRatio = static_cast<float>(contentsSize().width() ) / oldContentsWidth;
(...skipping 2415 matching lines...) Expand 10 before | Expand all | Expand 10 after
4047 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4050 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4048 4051
4049 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4052 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4050 return false; 4053 return false;
4051 4054
4052 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4055 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4053 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4056 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4054 } 4057 }
4055 4058
4056 } // namespace blink 4059 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698