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

Unified Diff: Source/devtools/front_end/sdk/OverridesSupport.js

Issue 321513004: [DevTools] Limit responsive design resize request to width/height only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Changed event.data 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/ResponsiveDesignView.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/sdk/OverridesSupport.js
diff --git a/Source/devtools/front_end/sdk/OverridesSupport.js b/Source/devtools/front_end/sdk/OverridesSupport.js
index ede7408e6c1d7af1a5ae3192d624d9176afa6cfe..8d46a0cde1002f1fbfdd9dbd296d0cb6e27801e9 100644
--- a/Source/devtools/front_end/sdk/OverridesSupport.js
+++ b/Source/devtools/front_end/sdk/OverridesSupport.js
@@ -601,11 +601,16 @@ WebInspector.OverridesSupport.prototype = {
_onPageResizerResizeRequested: function(event)
{
- var size = /** @type {!Size} */ (event.data);
- if (size.width !== this.settings.deviceWidth.get())
- this.settings.deviceWidth.set(size.width);
- if (size.height !== this.settings.deviceHeight.get())
- this.settings.deviceHeight.set(size.height);
+ if (typeof event.data.width !== "undefined") {
+ var width = /** @type {number} */ (event.data.width);
+ if (width !== this.settings.deviceWidth.get())
+ this.settings.deviceWidth.set(width);
+ }
+ if (typeof event.data.height !== "undefined") {
+ var height = /** @type {number} */ (event.data.height);
+ if (height !== this.settings.deviceHeight.get())
+ this.settings.deviceHeight.set(height);
+ }
},
_deviceMetricsChanged: function()
« no previous file with comments | « Source/devtools/front_end/ResponsiveDesignView.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698