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

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

Issue 1650243004: [DevTools] Option to show device frames in emulation mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trimming some dead code Created 4 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 // 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 /** 263 /**
264 * @param {!WebInspector.ContextMenu} contextMenu 264 * @param {!WebInspector.ContextMenu} contextMenu
265 */ 265 */
266 _appendOptionsMenuItems: function(contextMenu) 266 _appendOptionsMenuItems: function(contextMenu)
267 { 267 {
268 contextMenu.appendCheckboxItem(WebInspector.UIString("Show device pixel ratio"), this._toggleDeviceScaleFactor.bind(this), this._showDeviceScaleFactorSe tting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None); 268 contextMenu.appendCheckboxItem(WebInspector.UIString("Show device pixel ratio"), this._toggleDeviceScaleFactor.bind(this), this._showDeviceScaleFactorSe tting.get(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
269 contextMenu.appendCheckboxItem(WebInspector.UIString("Show device type") , this._toggleUserAgentType.bind(this), this._showUserAgentTypeSetting.get(), th is._model.type() === WebInspector.DeviceModeModel.Type.None); 269 contextMenu.appendCheckboxItem(WebInspector.UIString("Show device type") , this._toggleUserAgentType.bind(this), this._showUserAgentTypeSetting.get(), th is._model.type() === WebInspector.DeviceModeModel.Type.None);
270 contextMenu.appendCheckboxItem(WebInspector.UIString("Show throttling"), this._toggleNetworkConditions.bind(this), this._showNetworkConditionsSetting.ge t(), this._model.type() === WebInspector.DeviceModeModel.Type.None); 270 contextMenu.appendCheckboxItem(WebInspector.UIString("Show throttling"), this._toggleNetworkConditions.bind(this), this._showNetworkConditionsSetting.ge t(), this._model.type() === WebInspector.DeviceModeModel.Type.None);
271 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries "), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get() , this._model.type() === WebInspector.DeviceModeModel.Type.None); 271 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries "), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get() , this._model.type() === WebInspector.DeviceModeModel.Type.None);
272 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() == = WebInspector.DeviceModeModel.Type.None); 272 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() == = WebInspector.DeviceModeModel.Type.None);
273 contextMenu.appendSeparator(); 273 var deviceOutlineSetting = this._model.deviceOutlineSetting();
274 contextMenu.appendCheckboxItem(WebInspector.UIString("Show device frame" ), deviceOutlineSetting.set.bind(deviceOutlineSetting, !deviceOutlineSetting.get ()), deviceOutlineSetting.get() && this._model.outlineImage() !== "", !this._mod el.outlineImage());
dgozman 2016/03/21 21:08:38 Do not alter the disabled/checked state based on t
mmccoy 2016/03/21 22:03:05 Done.
dgozman 2016/03/22 20:30:49 You should not check this._model.outlineImage() he
274 contextMenu.appendItemsAtLocation("deviceModeMenu"); 275 contextMenu.appendItemsAtLocation("deviceModeMenu");
275 contextMenu.appendSeparator(); 276 contextMenu.appendSeparator();
276 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this. _reset.bind(this)); 277 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this. _reset.bind(this));
277 }, 278 },
278 279
279 _toggleDeviceScaleFactor: function() 280 _toggleDeviceScaleFactor: function()
280 { 281 {
281 this._showDeviceScaleFactorSetting.set(!this._showDeviceScaleFactorSetti ng.get()); 282 this._showDeviceScaleFactorSetting.set(!this._showDeviceScaleFactorSetti ng.get());
282 }, 283 },
283 284
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 this._emulateDevice(device); 573 this._emulateDevice(device);
573 return; 574 return;
574 } 575 }
575 } 576 }
576 } 577 }
577 } 578 }
578 579
579 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null); 580 this._model.emulate(WebInspector.DeviceModeModel.Type.Responsive, null, null);
580 } 581 }
581 } 582 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698