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

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

Issue 23592015: Use constrained values for shouldDisableDesktopWorkarounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 7 years, 3 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
« no previous file with comments | « no previous file | 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 4088 matching lines...) Expand 10 before | Expand all | Expand 10 after
4099 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); 4099 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event);
4100 4100
4101 if (page()) 4101 if (page())
4102 page()->pointerLockController().dispatchLockedMouseEvent( 4102 page()->pointerLockController().dispatchLockedMouseEvent(
4103 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), 4103 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent),
4104 eventType); 4104 eventType);
4105 } 4105 }
4106 4106
4107 bool WebViewImpl::shouldDisableDesktopWorkarounds() 4107 bool WebViewImpl::shouldDisableDesktopWorkarounds()
4108 { 4108 {
4109 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport Arguments(); 4109 if (!settings()->viewportEnabled() || !isFixedLayoutModeEnabled())
4110 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments. userZoom 4110 return false;
4111 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp ortArguments::ValueAuto); 4111
4112 // A document is considered adapted to small screen UAs if one of these hold s:
4113 // 1. The author specified viewport has a constrained width that is equal to
4114 // the initial viewport width.
4115 // 2. The author has disabled viewport zoom.
4116
4117 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4118
4119 return fixedLayoutSize().width == m_size.width
4120 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4112 } 4121 }
4113 4122
4114 } // namespace WebKit 4123 } // namespace WebKit
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698