| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2014 Google Inc. All rights reserved. | 2 * Copyright (C) 2014 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 { | 36 { |
| 37 WebInspector.VBox.call(this); | 37 WebInspector.VBox.call(this); |
| 38 this.registerRequiredCSS("overrides.css"); | 38 this.registerRequiredCSS("overrides.css"); |
| 39 this.registerRequiredCSS("helpScreen.css"); | 39 this.registerRequiredCSS("helpScreen.css"); |
| 40 this.element.classList.add("overrides-view"); | 40 this.element.classList.add("overrides-view"); |
| 41 | 41 |
| 42 this._tabbedPane = new WebInspector.TabbedPane(); | 42 this._tabbedPane = new WebInspector.TabbedPane(); |
| 43 this._tabbedPane.shrinkableTabs = false; | 43 this._tabbedPane.shrinkableTabs = false; |
| 44 this._tabbedPane.verticalTabLayout = true; | 44 this._tabbedPane.verticalTabLayout = true; |
| 45 | 45 |
| 46 new WebInspector.OverridesView.DeviceTab().appendAsTab(this._tabbedPane); | 46 if (!WebInspector.overridesSupport.isInspectingDevice()) { |
| 47 new WebInspector.OverridesView.ViewportTab().appendAsTab(this._tabbedPane); | 47 new WebInspector.OverridesView.DeviceTab().appendAsTab(this._tabbedPane)
; |
| 48 new WebInspector.OverridesView.ViewportTab().appendAsTab(this._tabbedPan
e); |
| 49 } |
| 48 new WebInspector.OverridesView.UserAgentTab().appendAsTab(this._tabbedPane); | 50 new WebInspector.OverridesView.UserAgentTab().appendAsTab(this._tabbedPane); |
| 49 new WebInspector.OverridesView.SensorsTab().appendAsTab(this._tabbedPane); | 51 new WebInspector.OverridesView.SensorsTab().appendAsTab(this._tabbedPane); |
| 50 | 52 |
| 51 this._lastSelectedTabSetting = WebInspector.settings.createSetting("lastSele
ctedEmulateTab", "device"); | 53 this._lastSelectedTabSetting = WebInspector.settings.createSetting("lastSele
ctedEmulateTab", "device"); |
| 52 this._tabbedPane.selectTab(this._lastSelectedTabSetting.get()); | 54 this._tabbedPane.selectTab(this._lastSelectedTabSetting.get()); |
| 53 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted, this._tabSelected, this); | 55 this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSele
cted, this._tabSelected, this); |
| 54 this._tabbedPane.show(this.element); | 56 this._tabbedPane.show(this.element); |
| 55 | 57 |
| 56 this._warningFooter = this.element.createChild("div", "overrides-footer"); | 58 this._warningFooter = this.element.createChild("div", "overrides-footer"); |
| 57 this._overridesWarningUpdated(); | 59 this._overridesWarningUpdated(); |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 __proto__: WebInspector.OverridesView.Tab.prototype | 813 __proto__: WebInspector.OverridesView.Tab.prototype |
| 812 } | 814 } |
| 813 | 815 |
| 814 | 816 |
| 815 /** | 817 /** |
| 816 * @constructor | 818 * @constructor |
| 817 * @extends {WebInspector.OverridesView.Tab} | 819 * @extends {WebInspector.OverridesView.Tab} |
| 818 */ | 820 */ |
| 819 WebInspector.OverridesView.SensorsTab = function() | 821 WebInspector.OverridesView.SensorsTab = function() |
| 820 { | 822 { |
| 821 WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("
Sensors"), [WebInspector.overridesSupport.settings.emulateTouchEvents, WebInspec
tor.overridesSupport.settings.overrideGeolocation, WebInspector.overridesSupport
.settings.overrideDeviceOrientation]); | 823 var settings = [WebInspector.overridesSupport.settings.overrideGeolocation,
WebInspector.overridesSupport.settings.overrideDeviceOrientation]; |
| 824 if (!WebInspector.overridesSupport.hasTouchInputs()) |
| 825 settings.push(WebInspector.overridesSupport.settings.emulateTouchEvents)
; |
| 826 WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("
Sensors"), settings); |
| 827 |
| 822 this.element.classList.add("overrides-sensors"); | 828 this.element.classList.add("overrides-sensors"); |
| 823 this.registerRequiredCSS("accelerometer.css"); | 829 this.registerRequiredCSS("accelerometer.css"); |
| 824 if (!WebInspector.overridesSupport.hasTouchInputs()) | 830 if (!WebInspector.overridesSupport.hasTouchInputs()) |
| 825 this.element.appendChild(this._createSettingCheckbox(WebInspector.UIStri
ng("Emulate touch screen"), WebInspector.overridesSupport.settings.emulateTouchE
vents)); | 831 this.element.appendChild(this._createSettingCheckbox(WebInspector.UIStri
ng("Emulate touch screen"), WebInspector.overridesSupport.settings.emulateTouchE
vents)); |
| 826 this._appendGeolocationOverrideControl(); | 832 this._appendGeolocationOverrideControl(); |
| 827 this._apendDeviceOrientationOverrideControl(); | 833 this._apendDeviceOrientationOverrideControl(); |
| 828 } | 834 } |
| 829 | 835 |
| 830 WebInspector.OverridesView.SensorsTab.prototype = { | 836 WebInspector.OverridesView.SensorsTab.prototype = { |
| 831 _appendGeolocationOverrideControl: function() | 837 _appendGeolocationOverrideControl: function() |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 | 1084 |
| 1079 __proto__ : WebInspector.OverridesView.Tab.prototype | 1085 __proto__ : WebInspector.OverridesView.Tab.prototype |
| 1080 } | 1086 } |
| 1081 | 1087 |
| 1082 /** @enum {string} */ | 1088 /** @enum {string} */ |
| 1083 WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = { | 1089 WebInspector.OverridesView.SensorsTab.DeviceOrientationModificationSource = { |
| 1084 UserInput: "userInput", | 1090 UserInput: "userInput", |
| 1085 UserDrag: "userDrag", | 1091 UserDrag: "userDrag", |
| 1086 ResetButton: "resetButton" | 1092 ResetButton: "resetButton" |
| 1087 } | 1093 } |
| OLD | NEW |