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 617 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 { | 628 { |
629 deviceScaleFactorSubmenu.appendCheckboxItem(title, deviceScaleFactor
Setting.set.bind(deviceScaleFactorSetting, value), deviceScaleFactorValue === va
lue, deviceScaleFactorDisabled); | 629 deviceScaleFactorSubmenu.appendCheckboxItem(title, deviceScaleFactor
Setting.set.bind(deviceScaleFactorSetting, value), deviceScaleFactorValue === va
lue, deviceScaleFactorDisabled); |
630 } | 630 } |
631 | 631 |
632 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this.
_model.reset.bind(this._model), this._model.type() !== WebInspector.DeviceModeMo
del.Type.Responsive); | 632 contextMenu.appendItem(WebInspector.UIString("Reset to defaults"), this.
_model.reset.bind(this._model), this._model.type() !== WebInspector.DeviceModeMo
del.Type.Responsive); |
633 contextMenu.appendSeparator(); | 633 contextMenu.appendSeparator(); |
634 | 634 |
635 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries
"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get()
, this._model.type() === WebInspector.DeviceModeModel.Type.None); | 635 contextMenu.appendCheckboxItem(WebInspector.UIString("Show media queries
"), this._toggleMediaInspector.bind(this), this._showMediaInspectorSetting.get()
, this._model.type() === WebInspector.DeviceModeModel.Type.None); |
636 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi
s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() ==
= WebInspector.DeviceModeModel.Type.None); | 636 contextMenu.appendCheckboxItem(WebInspector.UIString("Show rulers"), thi
s._toggleRulers.bind(this), this._showRulersSetting.get(), this._model.type() ==
= WebInspector.DeviceModeModel.Type.None); |
637 contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"),
this._openNetworkConfig.bind(this), false); | 637 contextMenu.appendItem(WebInspector.UIString("Configure network\u2026"),
this._openNetworkConfig.bind(this), false); |
| 638 contextMenu.appendItemsAtLocation("deviceModeMenu"); |
638 }, | 639 }, |
639 | 640 |
640 _toggleMediaInspector: function() | 641 _toggleMediaInspector: function() |
641 { | 642 { |
642 this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get
()); | 643 this._showMediaInspectorSetting.set(!this._showMediaInspectorSetting.get
()); |
643 }, | 644 }, |
644 | 645 |
645 _toggleRulers: function() | 646 _toggleRulers: function() |
646 { | 647 { |
647 this._showRulersSetting.set(!this._showRulersSetting.get()); | 648 this._showRulersSetting.set(!this._showRulersSetting.get()); |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 | 1024 |
1024 WebInspector.DeviceModeView.ActionDelegate.prototype = { | 1025 WebInspector.DeviceModeView.ActionDelegate.prototype = { |
1025 /** | 1026 /** |
1026 * @override | 1027 * @override |
1027 * @param {!WebInspector.Context} context | 1028 * @param {!WebInspector.Context} context |
1028 * @param {string} actionId | 1029 * @param {string} actionId |
1029 * @return {boolean} | 1030 * @return {boolean} |
1030 */ | 1031 */ |
1031 handleAction: function(context, actionId) | 1032 handleAction: function(context, actionId) |
1032 { | 1033 { |
1033 if (actionId === "emulation.toggle-device-mode" && WebInspector.DeviceMo
deView._wrapperInstance) { | 1034 if (WebInspector.DeviceModeView._wrapperInstance) { |
1034 WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode(); | 1035 if (actionId === "emulation.toggle-device-mode") { |
1035 return true; | 1036 WebInspector.DeviceModeView._wrapperInstance._toggleDeviceMode()
; |
| 1037 return true; |
| 1038 } |
| 1039 if (actionId === "emulation.request-app-banner") { |
| 1040 WebInspector.DeviceModeView._wrapperInstance._requestAppBanner()
; |
| 1041 return true; |
| 1042 } |
1036 } | 1043 } |
1037 return false; | 1044 return false; |
1038 } | 1045 } |
1039 } | 1046 } |
1040 | 1047 |
1041 | 1048 |
1042 /** | 1049 /** |
1043 * @extends {WebInspector.VBox} | 1050 * @extends {WebInspector.VBox} |
1044 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder | 1051 * @param {!WebInspector.InspectedPagePlaceholder} inspectedPagePlaceholder |
1045 * @constructor | 1052 * @constructor |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 this._deviceModeView.show(this.element); | 1085 this._deviceModeView.show(this.element); |
1079 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); | 1086 this._inspectedPagePlaceholder.clearMinimumSizeAndMargins(); |
1080 this._inspectedPagePlaceholder.show(this._deviceModeView.element); | 1087 this._inspectedPagePlaceholder.show(this._deviceModeView.element); |
1081 } else { | 1088 } else { |
1082 this._deviceModeView.detach(); | 1089 this._deviceModeView.detach(); |
1083 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); | 1090 this._inspectedPagePlaceholder.restoreMinimumSizeAndMargins(); |
1084 this._inspectedPagePlaceholder.show(this.element); | 1091 this._inspectedPagePlaceholder.show(this.element); |
1085 } | 1092 } |
1086 }, | 1093 }, |
1087 | 1094 |
| 1095 _requestAppBanner: function() |
| 1096 { |
| 1097 this._deviceModeView._model.requestAppBanner(); |
| 1098 }, |
| 1099 |
1088 __proto__: WebInspector.VBox.prototype | 1100 __proto__: WebInspector.VBox.prototype |
1089 } | 1101 } |
OLD | NEW |