| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 */ | 8 */ |
| 9 WebInspector.DeviceModeView = function() | 9 WebInspector.DeviceModeView = function() |
| 10 { | 10 { |
| (...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 { | 621 { |
| 622 deviceScaleFactorSubmenu.appendCheckboxItem(title, deviceScaleFactor
Setting.set.bind(deviceScaleFactorSetting, value), deviceScaleFactorValue === va
lue, deviceScaleFactorDisabled); | 622 deviceScaleFactorSubmenu.appendCheckboxItem(title, deviceScaleFactor
Setting.set.bind(deviceScaleFactorSetting, value), deviceScaleFactorValue === va
lue, deviceScaleFactorDisabled); |
| 623 } | 623 } |
| 624 | 624 |
| 625 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this.
_model.reset.bind(this._model), this._model.type() !== WebInspector.DeviceModeMo
del.Type.Responsive); | 625 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this.
_model.reset.bind(this._model), this._model.type() !== WebInspector.DeviceModeMo
del.Type.Responsive); |
| 626 contextMenu.appendSeparator(); | 626 contextMenu.appendSeparator(); |
| 627 | 627 |
| 628 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries
"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get()
, this._model.type() === WebInspector.DeviceModeModel.Type.None); | 628 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries
"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get()
, this._model.type() === WebInspector.DeviceModeModel.Type.None); |
| 629 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi
s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() ==
= WebInspector.DeviceModeModel.Type.None); | 629 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi
s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() ==
= WebInspector.DeviceModeModel.Type.None); |
| 630 contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"),
this._openNetworkConfig.bind(this), false); | 630 contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"),
this._openNetworkConfig.bind(this), false); |
| 631 contextMenu.appendItemsAtLocation("deviceModeMenu"); |
| 631 }, | 632 }, |
| 632 | 633 |
| 633 _toggleMediaInspector: function() | 634 _toggleMediaInspector: function() |
| 634 { | 635 { |
| 635 this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get
()); | 636 this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get
()); |
| 636 }, | 637 }, |
| 637 | 638 |
| 638 _toggleRulers: function() | 639 _toggleRulers: function() |
| 639 { | 640 { |
| 640 this._showRulersSetting.set(!this._showRulersSetting.get()); | 641 this._showRulersSetting.set(!this._showRulersSetting.get()); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1044 | 1045 |
| 1045 WebInspector.DeviceModeView.ActionDelegate.prototype = { | 1046 WebInspector.DeviceModeView.ActionDelegate.prototype = { |
| 1046 /** | 1047 /** |
| 1047 * @override | 1048 * @override |
| 1048 * @param {!WebInspector.Context} context | 1049 * @param {!WebInspector.Context} context |
| 1049 * @param {string} actionId | 1050 * @param {string} actionId |
| 1050 * @return {boolean} | 1051 * @return {boolean} |
| 1051 */ | 1052 */ |
| 1052 handleAction: function(context, actionId) | 1053 handleAction: function(context, actionId) |
| 1053 { | 1054 { |
| 1054 if (actionId === "emulation.toggle-device-mode" && WebInspector.DeviceMo
deView._wrapperInstance) { | 1055 if (WebInspector.DeviceModeView._wrapperInstance) { |
| 1055 WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode(); | 1056 if (actionId === "emulation.toggle-device-mode") { |
| 1056 return true; | 1057 WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode()
; |
| 1058 return true; |
| 1059 } |
| 1060 if (actionId === "emulation.request-app-banner") { |
| 1061 WebInspector.DeviceModeView._wrapperInstance._requestAppBanner()
; |
| 1062 return true; |
| 1063 } |
| 1057 } | 1064 } |
| 1058 return false; | 1065 return false; |
| 1059 } | 1066 } |
| 1060 } | 1067 } |
| 1061 | 1068 |
| 1062 | 1069 |
| 1063 /** | 1070 /** |
| 1064 * @extends {WebInspector.VBox} | 1071 * @extends {WebInspector.VBox} |
| 1065 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder | 1072 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder |
| 1066 * @constructor | 1073 * @constructor |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1100 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); | 1107 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); |
| 1101 this._inspectedPagePlaceholder.show(this._deviceModeView.element); | 1108 this._inspectedPagePlaceholder.show(this._deviceModeView.element); |
| 1102 } else { | 1109 } else { |
| 1103 this._deviceModeView.detach(); | 1110 this._deviceModeView.detach(); |
| 1104 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); | 1111 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); |
| 1105 this._inspectedPagePlaceholder.show(this.element); | 1112 this._inspectedPagePlaceholder.show(this.element); |
| 1106 } | 1113 } |
| 1107 this._deviceModeView.toggleDeviceMode(); | 1114 this._deviceModeView.toggleDeviceMode(); |
| 1108 }, | 1115 }, |
| 1109 | 1116 |
| 1117 _requestAppBanner: function() |
| 1118 { |
| 1119 this._deviceModeView._model.requestAppBanner(); |
| 1120 }, |
| 1121 |
| 1110 __proto__: WebInspector.VBox.prototype | 1122 __proto__: WebInspector.VBox.prototype |
| 1111 } | 1123 } |
| OLD | NEW |