| OLD | NEW |
| 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 contextMenu.appendCheckboxItem(title, uaSetting.set.bind(uaSetting,
value), uaSetting.get() === value); | 260 contextMenu.appendCheckboxItem(title, uaSetting.set.bind(uaSetting,
value), uaSetting.get() === value); |
| 261 } | 261 } |
| 262 }, | 262 }, |
| 263 | 263 |
| 264 /** | 264 /** |
| 265 * @param {!WebInspector.ContextMenu} contextMenu | 265 * @param {!WebInspector.ContextMenu} contextMenu |
| 266 */ | 266 */ |
| 267 _appendOptionsMenuItems: function(contextMenu) | 267 _appendOptionsMenuItems: function(contextMenu) |
| 268 { | 268 { |
| 269 var submenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Show"
)); | 269 var submenu = contextMenu.appendSubMenuItem(WebInspector.UIString("Show"
)); |
| 270 if (Runtime.experiments.isEnabled("deviceFrames")) | 270 submenu.appendCheckboxItem(WebInspector.UIString("Device frame"), this._
toggleDeviceOutline.bind(this), this._deviceOutlineSetting.get(), this._model.ty
pe() !== WebInspector.DeviceModeModel.Type.Device); |
| 271 submenu.appendCheckboxItem(WebInspector.UIString("Device frame"), th
is._toggleDeviceFrames.bind(this), this._deviceOutlineSetting.get(), this._model
.type() !== WebInspector.DeviceModeModel.Type.Device); | |
| 272 submenu.appendCheckboxItem(WebInspector.UIString("Device pixel ratio"),
this._toggleDeviceScaleFactor.bind(this), this._showDeviceScaleFactorSetting.get
(), this._model.type() === WebInspector.DeviceModeModel.Type.None); | 271 submenu.appendCheckboxItem(WebInspector.UIString("Device pixel ratio"),
this._toggleDeviceScaleFactor.bind(this), this._showDeviceScaleFactorSetting.get
(), this._model.type() === WebInspector.DeviceModeModel.Type.None); |
| 273 submenu.appendCheckboxItem(WebInspector.UIString("Device type"), this._t
oggleUserAgentType.bind(this), this._showUserAgentTypeSetting.get(), this._model
.type() === WebInspector.DeviceModeModel.Type.None); | 272 submenu.appendCheckboxItem(WebInspector.UIString("Device type"), this._t
oggleUserAgentType.bind(this), this._showUserAgentTypeSetting.get(), this._model
.type() === WebInspector.DeviceModeModel.Type.None); |
| 274 submenu.appendCheckboxItem(WebInspector.UIString("Network throttling"),
this._toggleNetworkConditions.bind(this), this._showNetworkConditionsSetting.get
(), this._model.type() === WebInspector.DeviceModeModel.Type.None); | 273 submenu.appendCheckboxItem(WebInspector.UIString("Network throttling"),
this._toggleNetworkConditions.bind(this), this._showNetworkConditionsSetting.get
(), this._model.type() === WebInspector.DeviceModeModel.Type.None); |
| 275 submenu.appendCheckboxItem(WebInspector.UIString("Media queries"), this.
_toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get(), this._m
odel.type() === WebInspector.DeviceModeModel.Type.None); | 274 submenu.appendCheckboxItem(WebInspector.UIString("Media queries"), this.
_toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get(), this._m
odel.type() === WebInspector.DeviceModeModel.Type.None); |
| 276 submenu.appendCheckboxItem(WebInspector.UIString("Rulers"), this._toggle
Rulers.bind(this), this._showRulersSetting.get(), this._model.type() === WebInsp
ector.DeviceModeModel.Type.None); | 275 submenu.appendCheckboxItem(WebInspector.UIString("Rulers"), this._toggle
Rulers.bind(this), this._showRulersSetting.get(), this._model.type() === WebInsp
ector.DeviceModeModel.Type.None); |
| 277 contextMenu.appendSeparator(); | 276 contextMenu.appendSeparator(); |
| 278 contextMenu.appendItemsAtLocation("deviceModeMenu"); | 277 contextMenu.appendItemsAtLocation("deviceModeMenu"); |
| 279 contextMenu.appendSeparator(); | 278 contextMenu.appendSeparator(); |
| 280 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this.
_reset.bind(this)); | 279 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this.
_reset.bind(this)); |
| 281 }, | 280 }, |
| 282 | 281 |
| 283 _toggleDeviceScaleFactor: function() | 282 _toggleDeviceScaleFactor: function() |
| 284 { | 283 { |
| 285 this._showDeviceScaleFactorSetting.set(!this._showDeviceScaleFactorSetti
ng.get()); | 284 this._showDeviceScaleFactorSetting.set(!this._showDeviceScaleFactorSetti
ng.get()); |
| 286 }, | 285 }, |
| 287 | 286 |
| 288 _toggleDeviceFrames: function() | 287 _toggleDeviceOutline: function() |
| 289 { | 288 { |
| 290 this._deviceOutlineSetting.set(!this._deviceOutlineSetting.get()); | 289 this._deviceOutlineSetting.set(!this._deviceOutlineSetting.get()); |
| 291 }, | 290 }, |
| 292 | 291 |
| 293 _toggleUserAgentType: function() | 292 _toggleUserAgentType: function() |
| 294 { | 293 { |
| 295 this._showUserAgentTypeSetting.set(!this._showUserAgentTypeSetting.get()
); | 294 this._showUserAgentTypeSetting.set(!this._showUserAgentTypeSetting.get()
); |
| 296 }, | 295 }, |
| 297 | 296 |
| 298 _toggleMediaInspector: function() | 297 _toggleMediaInspector: function() |
| (...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 this._emulateDevice(device); | 580 this._emulateDevice(device); |
| 582 return; | 581 return; |
| 583 } | 582 } |
| 584 } | 583 } |
| 585 } | 584 } |
| 586 } | 585 } |
| 587 | 586 |
| 588 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null,
null); | 587 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null,
null); |
| 589 } | 588 } |
| 590 } | 589 } |
| OLD | NEW |