Commit 1555b228 authored by vsevik@chromium.org's avatar vsevik@chromium.org

DevTools: Remove editor in drawer experiment

R=pfeldman

Review URL: https://codereview.chromium.org/422313002

git-svn-id: svn://svn.chromium.org/blink/trunk@179154 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent e972efe7
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
function onload() function onload()
{ {
testRunner.showWebInspector(JSON.stringify({lastActivePanel:"\"console\"", emulationEnabled: "true", drawerEditorShown: "false"})); testRunner.showWebInspector(JSON.stringify({lastActivePanel:"\"console\"", emulationEnabled: "true"}));
runTest(); runTest();
} }
......
...@@ -62,7 +62,6 @@ function initialize_extensionsPanelTest() ...@@ -62,7 +62,6 @@ function initialize_extensionsPanelTest()
} }
InspectorTest.recordNetwork(); InspectorTest.recordNetwork();
WebInspector.settings.createSetting("drawerEditorShown", true).set(false);
InspectorTest.addSniffer(WebInspector.inspectorView.panel("sources"), "showUILocation", showUILocationHook, true); InspectorTest.addSniffer(WebInspector.inspectorView.panel("sources"), "showUILocation", showUILocationHook, true);
InspectorTest.addSniffer(WebInspector.inspectorView.panel("resources"), "showResource", showResourceHook, true); InspectorTest.addSniffer(WebInspector.inspectorView.panel("resources"), "showResource", showResourceHook, true);
InspectorTest.addSniffer(WebInspector.inspectorView.panel("network"), "revealAndHighlightRequest", showRequestHook, true); InspectorTest.addSniffer(WebInspector.inspectorView.panel("network"), "revealAndHighlightRequest", showRequestHook, true);
......
...@@ -294,7 +294,6 @@ WebInspector.ExperimentsSettings = function(experimentsEnabled) ...@@ -294,7 +294,6 @@ WebInspector.ExperimentsSettings = function(experimentsEnabled)
this.devicesPanel = this._createExperiment("devicesPanel", "Devices panel"); this.devicesPanel = this._createExperiment("devicesPanel", "Devices panel");
this.disableAgentsWhenProfile = this._createExperiment("disableAgentsWhenProfile", "Disable other agents and UI when profiler is active", true); this.disableAgentsWhenProfile = this._createExperiment("disableAgentsWhenProfile", "Disable other agents and UI when profiler is active", true);
this.dockToLeft = this._createExperiment("dockToLeft", "Dock to left", true); this.dockToLeft = this._createExperiment("dockToLeft", "Dock to left", true);
this.editorInDrawer = this._createExperiment("showEditorInDrawer", "Editor in drawer", true);
this.fileSystemInspection = this._createExperiment("fileSystemInspection", "FileSystem inspection"); this.fileSystemInspection = this._createExperiment("fileSystemInspection", "FileSystem inspection");
this.frameworksDebuggingSupport = this._createExperiment("frameworksDebuggingSupport", "JavaScript frameworks debugging"); this.frameworksDebuggingSupport = this._createExperiment("frameworksDebuggingSupport", "JavaScript frameworks debugging");
this.gpuTimeline = this._createExperiment("gpuTimeline", "GPU data on timeline", true); this.gpuTimeline = this._createExperiment("gpuTimeline", "GPU data on timeline", true);
...@@ -597,7 +596,6 @@ WebInspector.VersionController.prototype = { ...@@ -597,7 +596,6 @@ WebInspector.VersionController.prototype = {
"sourcesPanelNavigatorSplitViewState": "sourcesPanelNavigatorSplitViewState", "sourcesPanelNavigatorSplitViewState": "sourcesPanelNavigatorSplitViewState",
"elementsPanelSplitViewState": "elementsPanelSplitViewState", "elementsPanelSplitViewState": "elementsPanelSplitViewState",
"canvasProfileViewReplaySplitViewState": "canvasProfileViewReplaySplitViewState", "canvasProfileViewReplaySplitViewState": "canvasProfileViewReplaySplitViewState",
"editorInDrawerSplitViewState": "editorInDrawerSplitViewState",
"stylesPaneSplitViewState": "stylesPaneSplitViewState", "stylesPaneSplitViewState": "stylesPaneSplitViewState",
"sourcesPanelDebuggerSidebarSplitViewState": "sourcesPanelDebuggerSidebarSplitViewState" "sourcesPanelDebuggerSidebarSplitViewState": "sourcesPanelDebuggerSidebarSplitViewState"
}; };
......
...@@ -41,12 +41,6 @@ WebInspector.Drawer = function(splitView) ...@@ -41,12 +41,6 @@ WebInspector.Drawer = function(splitView)
splitView.hideDefaultResizer(); splitView.hideDefaultResizer();
this.show(splitView.sidebarElement()); this.show(splitView.sidebarElement());
this._drawerEditorSplitView = new WebInspector.SplitView(true, true, "editorInDrawerSplitViewState", 0.5, 0.5);
this._drawerEditorSplitView.hideSidebar();
this._drawerEditorSplitView.addEventListener(WebInspector.SplitView.Events.ShowModeChanged, this._drawerEditorSplitViewShowModeChanged, this);
this._drawerEditorShownSetting = WebInspector.settings.createSetting("drawerEditorShown", true);
this._drawerEditorSplitView.show(this.element);
this._toggleDrawerButton = new WebInspector.StatusBarButton(WebInspector.UIString("Show drawer."), "console-status-bar-item"); this._toggleDrawerButton = new WebInspector.StatusBarButton(WebInspector.UIString("Show drawer."), "console-status-bar-item");
this._toggleDrawerButton.addEventListener("click", this.toggle, this); this._toggleDrawerButton.addEventListener("click", this.toggle, this);
...@@ -56,14 +50,9 @@ WebInspector.Drawer = function(splitView) ...@@ -56,14 +50,9 @@ WebInspector.Drawer = function(splitView)
this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, this._tabSelected, this); this._tabbedPane.addEventListener(WebInspector.TabbedPane.EventTypes.TabSelected, this._tabSelected, this);
new WebInspector.ExtensibleTabbedPaneController(this._tabbedPane, "drawer-view"); new WebInspector.ExtensibleTabbedPaneController(this._tabbedPane, "drawer-view");
this._toggleDrawerEditorButton = this._drawerEditorSplitView.createShowHideSidebarButton("editor in drawer", "drawer-editor-show-hide-button");
this._tabbedPane.element.appendChild(this._toggleDrawerEditorButton.element);
if (!WebInspector.experimentsSettings.editorInDrawer.isEnabled())
this.setDrawerEditorAvailable(false);
splitView.installResizer(this._tabbedPane.headerElement()); splitView.installResizer(this._tabbedPane.headerElement());
this._lastSelectedViewSetting = WebInspector.settings.createSetting("WebInspector.Drawer.lastSelectedView", "console"); this._lastSelectedViewSetting = WebInspector.settings.createSetting("WebInspector.Drawer.lastSelectedView", "console");
this._tabbedPane.show(this._drawerEditorSplitView.mainElement()); this._tabbedPane.show(this.element);
} }
WebInspector.Drawer.prototype = { WebInspector.Drawer.prototype = {
...@@ -127,7 +116,6 @@ WebInspector.Drawer.prototype = { ...@@ -127,7 +116,6 @@ WebInspector.Drawer.prototype = {
this.showView(this._lastSelectedViewSetting.get()); this.showView(this._lastSelectedViewSetting.get());
this._toggleDrawerButton.toggled = true; this._toggleDrawerButton.toggled = true;
this._toggleDrawerButton.title = WebInspector.UIString("Hide drawer."); this._toggleDrawerButton.title = WebInspector.UIString("Hide drawer.");
this._ensureDrawerEditorExistsIfNeeded();
}, },
willHide: function() willHide: function()
...@@ -201,79 +189,9 @@ WebInspector.Drawer.prototype = { ...@@ -201,79 +189,9 @@ WebInspector.Drawer.prototype = {
return this._tabbedPane.selectedTabId; return this._tabbedPane.selectedTabId;
}, },
/**
* @param {!WebInspector.Event} event
*/
_drawerEditorSplitViewShowModeChanged: function(event)
{
var mode = /** @type {string} */ (event.data);
var shown = mode === WebInspector.SplitView.ShowMode.Both;
if (this._isHidingDrawerEditor)
return;
this._drawerEditorShownSetting.set(shown);
if (!shown)
return;
this._ensureDrawerEditor();
this._drawerEditor.view().show(this._drawerEditorSplitView.sidebarElement());
},
initialPanelShown: function() initialPanelShown: function()
{ {
this._initialPanelWasShown = true; this._initialPanelWasShown = true;
this._ensureDrawerEditorExistsIfNeeded();
},
_ensureDrawerEditorExistsIfNeeded: function()
{
if (!this._initialPanelWasShown || !this.isShowing() || !this._drawerEditorShownSetting.get() || !WebInspector.experimentsSettings.editorInDrawer.isEnabled())
return;
this._ensureDrawerEditor();
},
_ensureDrawerEditor: function()
{
if (this._drawerEditor)
return;
this._drawerEditor = WebInspector.moduleManager.instance(WebInspector.DrawerEditor);
this._drawerEditor.installedIntoDrawer();
},
/**
* @param {boolean} available
*/
setDrawerEditorAvailable: function(available)
{
if (!WebInspector.experimentsSettings.editorInDrawer.isEnabled())
available = false;
this._toggleDrawerEditorButton.element.classList.toggle("hidden", !available);
},
showDrawerEditor: function()
{
if (!WebInspector.experimentsSettings.editorInDrawer.isEnabled())
return;
this._splitView.showBoth();
this._drawerEditorSplitView.showBoth();
},
hideDrawerEditor: function()
{
this._isHidingDrawerEditor = true;
this._drawerEditorSplitView.hideSidebar();
this._isHidingDrawerEditor = false;
},
/**
* @return {boolean}
*/
isDrawerEditorShown: function()
{
return this._drawerEditorShownSetting.get();
}, },
__proto__: WebInspector.VBox.prototype __proto__: WebInspector.VBox.prototype
...@@ -315,19 +233,3 @@ WebInspector.Drawer.SingletonViewFactory.prototype = { ...@@ -315,19 +233,3 @@ WebInspector.Drawer.SingletonViewFactory.prototype = {
return this._instance; return this._instance;
} }
} }
/**
* @interface
*/
WebInspector.DrawerEditor = function()
{
}
WebInspector.DrawerEditor.prototype = {
/**
* @return {!WebInspector.View}
*/
view: function() { },
installedIntoDrawer: function() { },
}
...@@ -198,32 +198,6 @@ WebInspector.InspectorView.prototype = { ...@@ -198,32 +198,6 @@ WebInspector.InspectorView.prototype = {
this._drawer.initialPanelShown(); this._drawer.initialPanelShown();
}, },
showDrawerEditor: function()
{
this._drawer.showDrawerEditor();
},
/**
* @return {boolean}
*/
isDrawerEditorShown: function()
{
return this._drawer.isDrawerEditorShown();
},
hideDrawerEditor: function()
{
this._drawer.hideDrawerEditor();
},
/**
* @param {boolean} available
*/
setDrawerEditorAvailable: function(available)
{
this._drawer.setDrawerEditorAvailable(available);
},
_tabSelected: function() _tabSelected: function()
{ {
var panelName = this._tabbedPane.selectedTabId; var panelName = this._tabbedPane.selectedTabId;
......
...@@ -67,8 +67,6 @@ WebInspector.SourcesPanel = function(workspaceForTest) ...@@ -67,8 +67,6 @@ WebInspector.SourcesPanel = function(workspaceForTest)
this.registerRequiredCSS("sourcesPanel.css"); this.registerRequiredCSS("sourcesPanel.css");
new WebInspector.UpgradeFileSystemDropTarget(this.element); new WebInspector.UpgradeFileSystemDropTarget(this.element);
WebInspector.settings.showEditorInDrawer = WebInspector.settings.createSetting("showEditorInDrawer", true);
this._workspace = workspaceForTest || WebInspector.workspace; this._workspace = workspaceForTest || WebInspector.workspace;
this.debugToolbar = this._createDebugToolbar(); this.debugToolbar = this._createDebugToolbar();
...@@ -98,13 +96,7 @@ WebInspector.SourcesPanel = function(workspaceForTest) ...@@ -98,13 +96,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSelected, this._editorSelected.bind(this)); this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorSelected, this._editorSelected.bind(this));
this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClosed, this._editorClosed.bind(this)); this._sourcesView.addEventListener(WebInspector.SourcesView.Events.EditorClosed, this._editorClosed.bind(this));
this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this)); this._sourcesView.registerShortcuts(this.registerShortcuts.bind(this));
this._sourcesView.show(this.editorView.mainElement());
if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) {
this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView();
this._sourcesView.show(this._drawerEditorView.element);
} else {
this._sourcesView.show(this.editorView.mainElement());
}
this._debugSidebarResizeWidgetElement = document.createElementWithClass("div", "resizer-widget"); this._debugSidebarResizeWidgetElement = document.createElementWithClass("div", "resizer-widget");
this._debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-widget"; this._debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-widget";
...@@ -197,33 +189,15 @@ WebInspector.SourcesPanel.prototype = { ...@@ -197,33 +189,15 @@ WebInspector.SourcesPanel.prototype = {
return this._paused; return this._paused;
}, },
/**
* @return {!WebInspector.SourcesPanel.DrawerEditor}
*/
_drawerEditor: function()
{
var drawerEditorInstance = WebInspector.moduleManager.instance(WebInspector.DrawerEditor);
console.assert(drawerEditorInstance instanceof WebInspector.SourcesPanel.DrawerEditor, "WebInspector.DrawerEditor module instance does not use WebInspector.SourcesPanel.DrawerEditor as an implementation. ");
return /** @type {!WebInspector.SourcesPanel.DrawerEditor} */ (drawerEditorInstance);
},
wasShown: function() wasShown: function()
{ {
WebInspector.context.setFlavor(WebInspector.SourcesPanel, this); WebInspector.context.setFlavor(WebInspector.SourcesPanel, this);
if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) {
this._drawerEditor()._panelWasShown();
this._sourcesView.show(this.editorView.mainElement());
}
WebInspector.Panel.prototype.wasShown.call(this); WebInspector.Panel.prototype.wasShown.call(this);
}, },
willHide: function() willHide: function()
{ {
WebInspector.Panel.prototype.willHide.call(this); WebInspector.Panel.prototype.willHide.call(this);
if (WebInspector.experimentsSettings.editorInDrawer.isEnabled()) {
this._drawerEditor()._panelWillHide();
this._sourcesView.show(this._drawerEditorView.element);
}
WebInspector.context.setFlavor(WebInspector.SourcesPanel, null); WebInspector.context.setFlavor(WebInspector.SourcesPanel, null);
}, },
...@@ -380,11 +354,7 @@ WebInspector.SourcesPanel.prototype = { ...@@ -380,11 +354,7 @@ WebInspector.SourcesPanel.prototype = {
{ {
if (this._sourcesView.isShowing()) if (this._sourcesView.isShowing())
return; return;
WebInspector.inspectorView.showPanel("sources");
if (this._shouldShowEditorInDrawer() && !forceShowInPanel)
this._drawerEditor()._show();
else
WebInspector.inspectorView.showPanel("sources");
}, },
/** /**
...@@ -396,14 +366,6 @@ WebInspector.SourcesPanel.prototype = { ...@@ -396,14 +366,6 @@ WebInspector.SourcesPanel.prototype = {
this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, forceShowInPanel); this.showUISourceCode(uiLocation.uiSourceCode, uiLocation.lineNumber, uiLocation.columnNumber, forceShowInPanel);
}, },
/**
* @return {boolean}
*/
_shouldShowEditorInDrawer: function()
{
return WebInspector.experimentsSettings.editorInDrawer.isEnabled() && WebInspector.settings.showEditorInDrawer.get() && WebInspector.inspectorView.isDrawerEditorShown();
},
/** /**
* @param {!WebInspector.UISourceCode} uiSourceCode * @param {!WebInspector.UISourceCode} uiSourceCode
*/ */
...@@ -1236,66 +1198,6 @@ WebInspector.UpgradeFileSystemDropTarget.prototype = { ...@@ -1236,66 +1198,6 @@ WebInspector.UpgradeFileSystemDropTarget.prototype = {
} }
} }
/**
* @constructor
* @implements {WebInspector.DrawerEditor}
*/
WebInspector.SourcesPanel.DrawerEditor = function()
{
this._panel = WebInspector.inspectorView.panel("sources");
}
WebInspector.SourcesPanel.DrawerEditor.prototype = {
/**
* @return {!WebInspector.View}
*/
view: function()
{
return this._panel._drawerEditorView;
},
installedIntoDrawer: function()
{
if (this._panel.isShowing())
this._panelWasShown();
else
this._panelWillHide();
},
_panelWasShown: function()
{
WebInspector.inspectorView.setDrawerEditorAvailable(false);
WebInspector.inspectorView.hideDrawerEditor();
},
_panelWillHide: function()
{
WebInspector.inspectorView.setDrawerEditorAvailable(true);
if (WebInspector.inspectorView.isDrawerEditorShown())
WebInspector.inspectorView.showDrawerEditor();
},
_show: function()
{
WebInspector.inspectorView.showDrawerEditor();
},
}
/**
* @constructor
* @extends {WebInspector.VBox}
*/
WebInspector.SourcesPanel.DrawerEditorView = function()
{
WebInspector.VBox.call(this);
this.element.id = "drawer-editor-view";
}
WebInspector.SourcesPanel.DrawerEditorView.prototype = {
__proto__: WebInspector.VBox.prototype
}
/** /**
* @constructor * @constructor
* @implements {WebInspector.ContextMenu.Provider} * @implements {WebInspector.ContextMenu.Provider}
......
...@@ -50,10 +50,6 @@ ...@@ -50,10 +50,6 @@
} }
] ]
}, },
{
"type": "@WebInspector.DrawerEditor",
"className": "WebInspector.SourcesPanel.DrawerEditor"
},
{ {
"type": "@WebInspector.Revealer", "type": "@WebInspector.Revealer",
"contextTypes": ["WebInspector.UILocation"], "contextTypes": ["WebInspector.UILocation"],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment