OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 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 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
454 }, | 454 }, |
455 | 455 |
456 _deviceMetricsChanged: function() | 456 _deviceMetricsChanged: function() |
457 { | 457 { |
458 if (this._deviceMetricsChangedListenerMuted) | 458 if (this._deviceMetricsChangedListenerMuted) |
459 return; | 459 return; |
460 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(W
ebInspector.settings.overrideDeviceMetrics.get() ? WebInspector.settings.deviceM
etrics.get() : ""); | 460 var metrics = WebInspector.OverridesSupport.DeviceMetrics.parseSetting(W
ebInspector.settings.overrideDeviceMetrics.get() ? WebInspector.settings.deviceM
etrics.get() : ""); |
461 if (!metrics.isValid()) | 461 if (!metrics.isValid()) |
462 return; | 462 return; |
463 | 463 |
464 var dipWidth = Math.round(metrics.width / metrics.deviceScaleFactor); | 464 var dipWidth = Math.round(metrics.width); |
465 var dipHeight = Math.round(metrics.height / metrics.deviceScaleFactor); | 465 var dipHeight = Math.round(metrics.height); |
466 | 466 |
467 // Disable override without checks. | 467 // Disable override without checks. |
468 if (dipWidth && dipHeight && WebInspector.OverridesSupport.isInspectingD
evice()) { | 468 if (dipWidth && dipHeight && WebInspector.OverridesSupport.isInspectingD
evice()) { |
469 this._updateDeviceMetricsWarningMessage(WebInspector.UIString("Scree
n emulation on the device is not available.")); | 469 this._updateDeviceMetricsWarningMessage(WebInspector.UIString("Scree
n emulation on the device is not available.")); |
470 return; | 470 return; |
471 } | 471 } |
472 | 472 |
473 PageAgent.setDeviceMetricsOverride(dipWidth, dipHeight, metrics.deviceSc
aleFactor, WebInspector.settings.emulateViewport.get(), WebInspector.settings.de
viceFitWindow.get(), metrics.textAutosizing, metrics.fontScaleFactor(), apiCallb
ack.bind(this)); | 473 PageAgent.setDeviceMetricsOverride(dipWidth, dipHeight, metrics.deviceSc
aleFactor, WebInspector.settings.emulateViewport.get(), WebInspector.settings.de
viceFitWindow.get(), metrics.textAutosizing, metrics.fontScaleFactor(), apiCallb
ack.bind(this)); |
474 this.maybeHasActiveOverridesChanged(); | 474 this.maybeHasActiveOverridesChanged(); |
475 | 475 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 }, | 595 }, |
596 | 596 |
597 __proto__: WebInspector.Object.prototype | 597 __proto__: WebInspector.Object.prototype |
598 } | 598 } |
599 | 599 |
600 | 600 |
601 /** | 601 /** |
602 * @type {!WebInspector.OverridesSupport} | 602 * @type {!WebInspector.OverridesSupport} |
603 */ | 603 */ |
604 WebInspector.overridesSupport; | 604 WebInspector.overridesSupport; |
OLD | NEW |