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

Unified Diff: third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js

Issue 2839413002: DevTools: add rendering overlay options to command menu (Closed)
Patch Set: ac Created 3 years, 7 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
Index: third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
index 51d51cb4d461702db64d093bd6e7fbd39bab237a..7d6ef9b4fd98bab1fcaabf8dbb6613d208efe1ea 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/EmulationModel.js
@@ -22,6 +22,11 @@ SDK.EmulationModel = class extends SDK.SDKModel {
if (disableJavascriptSetting.get())
this._emulationAgent.setScriptExecutionDisabled(true);
+ var mediaSetting = Common.moduleSetting('emulatedCSSMedia');
+ mediaSetting.addChangeListener(() => this.emulateCSSMedia(mediaSetting.get()));
+ if (mediaSetting.get())
+ this.emulateCSSMedia(mediaSetting.get());
+
this._touchEnabled = false;
this._touchMobile = false;
this._customTouchEnabled = false;
@@ -110,10 +115,10 @@ SDK.EmulationModel = class extends SDK.SDKModel {
}
/**
- * @param {?string} media
+ * @param {string} media
*/
emulateCSSMedia(media) {
dgozman 2017/05/16 18:47:25 Can now make this private.
luoe 2017/05/30 20:56:15 Done.
- this._emulationAgent.setEmulatedMedia(media || '');
+ this._emulationAgent.setEmulatedMedia(media);
if (this._cssModel)
this._cssModel.mediaQueryResultChanged();
}

Powered by Google App Engine
This is Rietveld 408576698