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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeToolbar.js

Issue 1688113002: Devtools: Add device frames to device mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @param {!WebInspector.DeviceModeModel} model 6 * @param {!WebInspector.DeviceModeModel} model
7 * @param {!WebInspector.Setting} showMediaInspectorSetting 7 * @param {!WebInspector.Setting} showMediaInspectorSetting
8 * @param {!WebInspector.Setting} showRulersSetting 8 * @param {!WebInspector.Setting} showRulersSetting
9 * @constructor 9 * @constructor
10 */ 10 */
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 * @param {number} value 234 * @param {number} value
235 */ 235 */
236 function appendDeviceScaleFactorItem(title, value) 236 function appendDeviceScaleFactorItem(title, value)
237 { 237 {
238 deviceScaleFactorSubmenu.appendCheckboxItem(title, deviceScaleFactor Setting.set.bind(deviceScaleFactorSetting, value), deviceScaleFactorValue === va lue, deviceScaleFactorDisabled); 238 deviceScaleFactorSubmenu.appendCheckboxItem(title, deviceScaleFactor Setting.set.bind(deviceScaleFactorSetting, value), deviceScaleFactorValue === va lue, deviceScaleFactorDisabled);
239 } 239 }
240 240
241 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this. _model.reset.bind(this._model), this._model.type() !== WebInspector.DeviceModeMo del.Type.Responsive); 241 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this. _model.reset.bind(this._model), this._model.type() !== WebInspector.DeviceModeMo del.Type.Responsive);
242 contextMenu.appendSeparator(); 242 contextMenu.appendSeparator();
243 243
244 var deviceOutlineSetting = this._model.deviceOutlineSetting();
245 contextMenu.appendCheckboxItem(WebInspector.UIString("Show device frame if available"), deviceOutlineSetting.set.bind(deviceOutlineSetting, !deviceOutli neSetting.get()), deviceOutlineSetting.get(), this._model.type() !== WebInspecto r.DeviceModeModel.Type.Device);
244 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries "), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get() , this._model.type() === WebInspector.DeviceModeModel.Type.None); 246 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries "), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get() , this._model.type() === WebInspector.DeviceModeModel.Type.None);
245 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() == = WebInspector.DeviceModeModel.Type.None); 247 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() == = WebInspector.DeviceModeModel.Type.None);
246 contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"), this._openNetworkConfig.bind(this), false); 248 contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"), this._openNetworkConfig.bind(this), false);
247 contextMenu.appendItemsAtLocation("deviceModeMenu"); 249 contextMenu.appendItemsAtLocation("deviceModeMenu");
248 }, 250 },
249 251
250 _toggleMediaInspector: function() 252 _toggleMediaInspector: function()
251 { 253 {
252 this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get ()); 254 this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get ());
253 }, 255 },
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 this._emulateDevice(device); 512 this._emulateDevice(device);
511 return; 513 return;
512 } 514 }
513 } 515 }
514 } 516 }
515 } 517 }
516 518
517 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); 519 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null);
518 } 520 }
519 } 521 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698