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

Unified Diff: Source/devtools/front_end/elements/OverridesView.js

Issue 269953006: [DevTools] Don't show UI for unavailable overrides. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/sdk/OverridesSupport.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/elements/OverridesView.js
diff --git a/Source/devtools/front_end/elements/OverridesView.js b/Source/devtools/front_end/elements/OverridesView.js
index be1c9d4aa5f6bf05a69ee7c2028bf8bf78326abc..931033f8b2100f5f7f0c1edaa56eaa7b8409d788 100644
--- a/Source/devtools/front_end/elements/OverridesView.js
+++ b/Source/devtools/front_end/elements/OverridesView.js
@@ -43,8 +43,10 @@ WebInspector.OverridesView = function()
this._tabbedPane.shrinkableTabs = false;
this._tabbedPane.verticalTabLayout = true;
- new WebInspector.OverridesView.DeviceTab().appendAsTab(this._tabbedPane);
- new WebInspector.OverridesView.ViewportTab().appendAsTab(this._tabbedPane);
+ if (!WebInspector.overridesSupport.isInspectingDevice()) {
+ new WebInspector.OverridesView.DeviceTab().appendAsTab(this._tabbedPane);
+ new WebInspector.OverridesView.ViewportTab().appendAsTab(this._tabbedPane);
+ }
new WebInspector.OverridesView.UserAgentTab().appendAsTab(this._tabbedPane);
new WebInspector.OverridesView.SensorsTab().appendAsTab(this._tabbedPane);
@@ -818,7 +820,11 @@ WebInspector.OverridesView.UserAgentTab.prototype = {
*/
WebInspector.OverridesView.SensorsTab = function()
{
- WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("Sensors"), [WebInspector.overridesSupport.settings.emulateTouchEvents, WebInspector.overridesSupport.settings.overrideGeolocation, WebInspector.overridesSupport.settings.overrideDeviceOrientation]);
+ var settings = [WebInspector.overridesSupport.settings.overrideGeolocation, WebInspector.overridesSupport.settings.overrideDeviceOrientation];
+ if (!WebInspector.overridesSupport.hasTouchInputs())
+ settings.push(WebInspector.overridesSupport.settings.emulateTouchEvents);
+ WebInspector.OverridesView.Tab.call(this, "sensors", WebInspector.UIString("Sensors"), settings);
+
this.element.classList.add("overrides-sensors");
this.registerRequiredCSS("accelerometer.css");
if (!WebInspector.overridesSupport.hasTouchInputs())
« no previous file with comments | « no previous file | Source/devtools/front_end/sdk/OverridesSupport.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698