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

Side by Side Diff: Source/devtools/front_end/OverridesSupport.js

Issue 212103004: [DevTools] Show device screen size in DIPs. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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
OLDNEW
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
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
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;
OLDNEW
« no previous file with comments | « no previous file | Source/devtools/front_end/OverridesView.js » ('j') | Source/devtools/front_end/OverridesView.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698