Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 function setMetaViewport(override) | 1 function setMetaViewport(override) |
| 2 { | 2 { |
| 3 var VIEWPORTS = { | 3 var VIEWPORTS = { |
| 4 "w=320": "width=320", | 4 "w=320": "width=320", |
| 5 "w=dw": "width=device-width", | 5 "w=dw": "width=device-width", |
| 6 "w=980": "width=980", | 6 "w=980": "width=980", |
| 7 "none": "no viewport (desktop site)" | 7 "none": "no viewport (desktop site)" |
| 8 }; | 8 }; |
| 9 | 9 |
| 10 var viewport = VIEWPORTS["none"]; | 10 var viewport = VIEWPORTS["none"]; |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 | 196 |
| 197 InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS caleFactor, viewport, insets, noReload, callback) | 197 InspectorTest.applyEmulationAndReload = function(enabled, width, height, deviceS caleFactor, viewport, insets, noReload, callback) |
| 198 { | 198 { |
| 199 if (enabled) { | 199 if (enabled) { |
| 200 var params = {}; | 200 var params = {}; |
| 201 params.width = width; | 201 params.width = width; |
| 202 params.height = height; | 202 params.height = height; |
| 203 params.deviceScaleFactor = deviceScaleFactor; | 203 params.deviceScaleFactor = deviceScaleFactor; |
| 204 params.mobile = true; | 204 params.mobile = true; |
| 205 params.fitWindow = false; | 205 params.fitWindow = false; |
| 206 params.scale = 1; | |
|
dgozman
2016/08/29 20:45:36
Please revert.
Eric Seckler
2016/09/12 13:58:00
Done.
| |
| 207 params.screenWidth = width; | 206 params.screenWidth = width; |
| 208 params.screenHeight = height; | 207 params.screenHeight = height; |
| 209 params.positionX = 0; | 208 params.positionX = 0; |
| 210 params.positionY = 0; | 209 params.positionY = 0; |
| 211 if (insets) { | 210 if (insets) { |
| 212 params.screenWidth += insets.left + insets.right; | 211 params.screenWidth += insets.left + insets.right; |
| 213 params.positionX = insets.left; | 212 params.positionX = insets.left; |
| 214 params.screenHeight += insets.top + insets.bottom; | 213 params.screenHeight += insets.top + insets.bottom; |
| 215 params.positionY = insets.top; | 214 params.positionY = insets.top; |
| 216 } | 215 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 250 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor t, insets, noReload, callback); | 249 InspectorTest.emulateAndGetMetrics(width, height, deviceScaleFactor, viewpor t, insets, noReload, callback); |
| 251 | 250 |
| 252 function callback() | 251 function callback() |
| 253 { | 252 { |
| 254 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); | 253 InspectorTest.log(InspectorTest._deviceEmulationResults.join("\n")); |
| 255 InspectorTest.completeTest(); | 254 InspectorTest.completeTest(); |
| 256 } | 255 } |
| 257 }; | 256 }; |
| 258 | 257 |
| 259 }; | 258 }; |
| OLD | NEW |