Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / SourcesPanel.js
index 4b2c37d..096c0a8 100644 (file)
@@ -33,7 +33,6 @@ importScript("FilteredItemSelectionDialog.js");
 importScript("UISourceCodeFrame.js");
 importScript("JavaScriptSourceFrame.js");
 importScript("CSSSourceFrame.js");
-importScript("NavigatorOverlayController.js");
 importScript("NavigatorView.js");
 importScript("RevisionHistoryView.js");
 importScript("ScopeChainSidebarPane.js");
@@ -60,7 +59,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
     this.registerRequiredCSS("sourcesPanel.css");
     this.registerRequiredCSS("textPrompt.css"); // Watch Expressions autocomplete.
 
-    WebInspector.settings.navigatorWasOnceHidden = WebInspector.settings.createSetting("navigatorWasOnceHidden", false);
+    WebInspector.settings.navigatorHidden = WebInspector.settings.createSetting("navigatorHidden", false);
     WebInspector.settings.debuggerSidebarHidden = WebInspector.settings.createSetting("debuggerSidebarHidden", false);
     WebInspector.settings.showEditorInDrawer = WebInspector.settings.createSetting("showEditorInDrawer", true);
 
@@ -78,27 +77,33 @@ WebInspector.SourcesPanel = function(workspaceForTest)
 
     var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString("Sources Panel"));
     this.debugToolbar = this._createDebugToolbar();
+    this._debugToolbarDrawer = this._createDebugToolbarDrawer();
     this.threadsToolbar = new WebInspector.ThreadsToolbar();
 
     const initialDebugSidebarWidth = 225;
-    const minimumDebugSidebarWidthPercent = 0.5;
-    this.createSidebarView(this.element, WebInspector.SidebarView.SidebarPosition.End, initialDebugSidebarWidth);
-    this.splitView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);
-    this.splitView.setMainElementConstraints(minimumDebugSidebarWidthPercent);
+    this._splitView = new WebInspector.SplitView(true, true, "sourcesSidebarWidth", initialDebugSidebarWidth);
+    this._splitView.setMainElementConstraints(200, 25);
+    this._splitView.setSidebarElementConstraints(WebInspector.SourcesPanel.minToolbarWidth, 25);
+
+    this._splitView.show(this.element);
+    if (WebInspector.settings.debuggerSidebarHidden.get())
+        this._splitView.hideSidebar();
 
     // Create scripts navigator
     const initialNavigatorWidth = 225;
     const minimumViewsContainerWidthPercent = 0.5;
-    this.editorView = new WebInspector.SidebarView(WebInspector.SidebarView.SidebarPosition.Start, "scriptsPanelNavigatorSidebarWidth", initialNavigatorWidth);
+    this.editorView = new WebInspector.SplitView(true, false, "scriptsPanelNavigatorSidebarWidth", initialNavigatorWidth);
+    if (WebInspector.settings.navigatorHidden.get())
+        this.editorView.hideSidebar();
     this.editorView.element.id = "scripts-editor-split-view";
     this.editorView.element.tabIndex = 0;
 
-    this.editorView.setSidebarElementConstraints(Preferences.minScriptsSidebarWidth);
+    this.editorView.setSidebarElementConstraints(Preferences.minSidebarWidth);
     this.editorView.setMainElementConstraints(minimumViewsContainerWidthPercent);
-    this.splitView.setMainView(this.editorView);
+    this.editorView.show(this._splitView.mainElement());
 
     this._navigator = new WebInspector.SourcesNavigator();
-    this.editorView.setSidebarView(this._navigator.view);
+    this._navigator.view.show(this.editorView.sidebarElement());
 
     var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIString("Hit Cmd+O to open a file") : WebInspector.UIString("Hit Ctrl+O to open a file");
 
@@ -111,8 +116,6 @@ WebInspector.SourcesPanel = function(workspaceForTest)
     this._editorContainer = new WebInspector.TabbedEditorContainer(this, "previouslyViewedFiles", tabbedEditorPlaceholderText);
     this._editorContainer.show(this._searchableView.element);
 
-    this._navigatorController = new WebInspector.NavigatorOverlayController(this.editorView, this._navigator.view, this._editorContainer.view);
-
     this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.SourceSelected, this._sourceSelected, this);
     this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemSearchStarted, this._itemSearchStarted, this);
     this._navigator.addEventListener(WebInspector.SourcesNavigator.Events.ItemCreationRequested, this._itemCreationRequested, this);
@@ -123,7 +126,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
 
     this._debugSidebarResizeWidgetElement = document.createElementWithClass("div", "resizer-widget");
     this._debugSidebarResizeWidgetElement.id = "scripts-debug-sidebar-resizer-widget";
-    this.splitView.installResizer(this._debugSidebarResizeWidgetElement);
+    this._splitView.installResizer(this._debugSidebarResizeWidgetElement);
 
     this.sidebarPanes = {};
     this.sidebarPanes.watchExpressions = new WebInspector.WatchExpressionsSidebarPane();
@@ -132,15 +135,13 @@ WebInspector.SourcesPanel = function(workspaceForTest)
     this.sidebarPanes.callstack.addEventListener(WebInspector.CallStackSidebarPane.Events.CallFrameRestarted, this._callFrameRestartedInSidebar.bind(this));
 
     this.sidebarPanes.scopechain = new WebInspector.ScopeChainSidebarPane();
-    this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.breakpointManager, this._showSourceLocation.bind(this));
+    this.sidebarPanes.jsBreakpoints = new WebInspector.JavaScriptBreakpointsSidebarPane(WebInspector.debuggerModel, WebInspector.breakpointManager, this._showSourceLocation.bind(this));
     this.sidebarPanes.domBreakpoints = WebInspector.domBreakpointsSidebarPane.createProxy(this);
     this.sidebarPanes.xhrBreakpoints = new WebInspector.XHRBreakpointsSidebarPane();
     this.sidebarPanes.eventListenerBreakpoints = new WebInspector.EventListenerBreakpointsSidebarPane();
 
-    if (Capabilities.canInspectWorkers && !WebInspector.WorkerManager.isWorkerFrontend()) {
-        WorkerAgent.enable();
-        this.sidebarPanes.workerList = new WebInspector.WorkersSidebarPane(WebInspector.workerManager);
-    }
+    if (Capabilities.canInspectWorkers && !WebInspector.isWorkerFrontend())
+        this.sidebarPanes.workerList = new WebInspector.WorkersSidebarPane();
 
     /**
      * @this {WebInspector.SourcesPanel}
@@ -172,7 +173,7 @@ WebInspector.SourcesPanel = function(workspaceForTest)
     this._scriptViewStatusBarItemsContainer.className = "inline-block";
 
     this._scriptViewStatusBarTextContainer = document.createElement("div");
-    this._scriptViewStatusBarTextContainer.className = "inline-block";
+    this._scriptViewStatusBarTextContainer.className = "hbox";
 
     this._statusBarContainerElement = this.sourcesView.element.createChild("div", "sources-status-bar");
     this._statusBarContainerElement.appendChild(this._toggleFormatSourceButton.element);
@@ -188,11 +189,11 @@ WebInspector.SourcesPanel = function(workspaceForTest)
     /** @type {!Map.<!WebInspector.UISourceCode, !WebInspector.SourceFrame>} */
     this._sourceFramesByUISourceCode = new Map();
     this._updateDebuggerButtons();
-    this._pauseOnExceptionStateChanged();
+    this._pauseOnExceptionEnabledChanged();
     if (WebInspector.debuggerModel.isPaused())
         this._showDebuggerPausedDetails();
 
-    WebInspector.settings.pauseOnExceptionStateString.addChangeListener(this._pauseOnExceptionStateChanged, this);
+    WebInspector.settings.pauseOnExceptionEnabled.addChangeListener(this._pauseOnExceptionEnabledChanged, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasEnabled, this._debuggerWasEnabled, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._debuggerWasDisabled, this);
     WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerPaused, this._debuggerPaused, this);
@@ -229,6 +230,8 @@ WebInspector.SourcesPanel = function(workspaceForTest)
     window.addEventListener("beforeunload", handleBeforeUnload.bind(this), true);
 }
 
+WebInspector.SourcesPanel.minToolbarWidth = 215;
+
 WebInspector.SourcesPanel.prototype = {
     /**
      * @param {?Event=} event
@@ -276,9 +279,8 @@ WebInspector.SourcesPanel.prototype = {
     wasShown: function()
     {
         WebInspector.inspectorView.closeViewInDrawer("editor");
-        this.editorView.setMainView(this.sourcesView);
+        this.sourcesView.show(this.editorView.mainElement());
         WebInspector.Panel.prototype.wasShown.call(this);
-        this._navigatorController.wasShown();
 
         this.element.addEventListener("keydown", this._boundOnKeyDown, false);
         this.element.addEventListener("keyup", this._boundOnKeyUp, false);
@@ -384,7 +386,7 @@ WebInspector.SourcesPanel.prototype = {
          */
         function didGetUILocation(uiLocation)
         {
-            var breakpoint = WebInspector.breakpointManager.findBreakpoint(uiLocation.uiSourceCode, uiLocation.lineNumber);
+            var breakpoint = WebInspector.breakpointManager.findBreakpointOnLine(uiLocation.uiSourceCode, uiLocation.lineNumber);
             if (!breakpoint)
                 return;
             this.sidebarPanes.jsBreakpoints.highlightBreakpoint(breakpoint);
@@ -480,24 +482,6 @@ WebInspector.SourcesPanel.prototype = {
     },
 
     /**
-     * @param {!Element} anchor
-     * @return {boolean}
-     */
-    showAnchorLocation: function(anchor)
-    {
-        if (!anchor.uiSourceCode) {
-            var uiSourceCode = WebInspector.workspace.uiSourceCodeForURL(anchor.href);
-            if (uiSourceCode)
-                anchor.uiSourceCode = uiSourceCode;
-        }
-        if (!anchor.uiSourceCode)
-            return false;
-
-        this._showSourceLocation(anchor.uiSourceCode, anchor.lineNumber, anchor.columnNumber);
-        return true;
-    },
-
-    /**
      * @param {!WebInspector.UISourceCode} uiSourceCode
      * @param {number=} lineNumber
      * @param {number=} columnNumber
@@ -738,7 +722,6 @@ WebInspector.SourcesPanel.prototype = {
 
     _editorClosed: function(event)
     {
-        this._navigatorController.hideNavigatorOverlay();
         var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
         this._historyManager.removeHistoryForSourceCode(uiSourceCode);
 
@@ -760,9 +743,6 @@ WebInspector.SourcesPanel.prototype = {
         if (shouldUseHistoryManager)
             this._historyManager.pushNewState();
 
-        this._navigatorController.hideNavigatorOverlay();
-        if (!this._navigatorController.isNavigatorPinned())
-            sourceFrame.focus();
         this._searchableView.setReplaceable(!!sourceFrame && sourceFrame.canEditSource());
         this._searchableView.resetSearch();
     },
@@ -779,8 +759,7 @@ WebInspector.SourcesPanel.prototype = {
         if (shouldUseHistoryManager)
             this._historyManager.pushNewState();
 
-        this._navigatorController.hideNavigatorOverlay();
-        if (sourceFrame && (!this._navigatorController.isNavigatorPinned() || event.data.focusSource))
+        if (sourceFrame && event.data.focusSource)
             sourceFrame.focus();
     },
 
@@ -790,21 +769,12 @@ WebInspector.SourcesPanel.prototype = {
         WebInspector.OpenResourceDialog.show(this, this.editorView.mainElement(), searchText);
     },
 
-    _pauseOnExceptionStateChanged: function()
+    _pauseOnExceptionEnabledChanged: function()
     {
-        var pauseOnExceptionsState = WebInspector.settings.pauseOnExceptionStateString.get();
-        switch (pauseOnExceptionsState) {
-        case WebInspector.DebuggerModel.PauseOnExceptionsState.DontPauseOnExceptions:
-            this._pauseOnExceptionButton.title = WebInspector.UIString("Don't pause on exceptions.\nClick to Pause on all exceptions.");
-            break;
-        case WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnAllExceptions:
-            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on all exceptions.\nClick to Pause on uncaught exceptions.");
-            break;
-        case WebInspector.DebuggerModel.PauseOnExceptionsState.PauseOnUncaughtExceptions:
-            this._pauseOnExceptionButton.title = WebInspector.UIString("Pause on uncaught exceptions.\nClick to Not pause on exceptions.");
-            break;
-        }
-        this._pauseOnExceptionButton.state = pauseOnExceptionsState;
+        var enabled = WebInspector.settings.pauseOnExceptionEnabled.get();
+        this._pauseOnExceptionButton.toggled = enabled;
+        this._pauseOnExceptionButton.title = WebInspector.UIString(enabled ? "Don't pause on exceptions." : "Pause on exceptions.");
+        this._debugToolbarDrawer.enableStyleClass("expanded", enabled);
     },
 
     _updateDebuggerButtons: function()
@@ -845,12 +815,7 @@ WebInspector.SourcesPanel.prototype = {
 
     _togglePauseOnExceptions: function()
     {
-        var nextStateMap = {};
-        var stateEnum = WebInspector.DebuggerModel.PauseOnExceptionsState;
-        nextStateMap[stateEnum.DontPauseOnExceptions] = stateEnum.PauseOnAllExceptions;
-        nextStateMap[stateEnum.PauseOnAllExceptions] = stateEnum.PauseOnUncaughtExceptions;
-        nextStateMap[stateEnum.PauseOnUncaughtExceptions] = stateEnum.DontPauseOnExceptions;
-        WebInspector.settings.pauseOnExceptionStateString.set(nextStateMap[this._pauseOnExceptionButton.state]);
+        WebInspector.settings.pauseOnExceptionEnabled.set(!this._pauseOnExceptionButton.toggled);
     },
 
     /**
@@ -1080,13 +1045,25 @@ WebInspector.SourcesPanel.prototype = {
         debugToolbar.appendChild(this._toggleBreakpointsButton.element);
 
         // Pause on Exception
-        this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item", 3);
+        this._pauseOnExceptionButton = new WebInspector.StatusBarButton("", "scripts-pause-on-exceptions-status-bar-item");
         this._pauseOnExceptionButton.addEventListener("click", this._togglePauseOnExceptions, this);
         debugToolbar.appendChild(this._pauseOnExceptionButton.element);
 
         return debugToolbar;
     },
 
+    _createDebugToolbarDrawer: function()
+    {
+        var debugToolbarDrawer = document.createElement("div");
+        debugToolbarDrawer.className = "scripts-debug-toolbar-drawer";
+
+        var label = WebInspector.UIString("Pause On Caught Exceptions");
+        var setting = WebInspector.settings.pauseOnCaughtException;
+        debugToolbarDrawer.appendChild(WebInspector.SettingsUI.createSettingCheckbox(label, setting, true));
+
+        return debugToolbarDrawer;
+    },
+
     /**
      * @param {!WebInspector.StatusBarButton} button
      * @param {string} buttonTitle
@@ -1312,12 +1289,17 @@ WebInspector.SourcesPanel.prototype = {
 
     _installDebuggerSidebarController: function()
     {
+        this._toggleNavigatorSidebarButton = new WebInspector.StatusBarButton("", "left-sidebar-show-hide-button", 3);
+        this._toggleNavigatorSidebarButton.addEventListener("click", navigatorHandler, this);
+        this.sourcesView.element.appendChild(this._toggleNavigatorSidebarButton.element);
+        this._enableNavigatorSidebar(!WebInspector.settings.navigatorHidden.get());
+
         this._toggleDebuggerSidebarButton = new WebInspector.StatusBarButton("", "right-sidebar-show-hide-button scripts-debugger-show-hide-button", 3);
-        this._toggleDebuggerSidebarButton.addEventListener("click", clickHandler, this);
+        this._toggleDebuggerSidebarButton.addEventListener("click", debuggerHandler, this);
 
-        if (this.splitView.isVertical()) {
+        if (this._splitView.isVertical()) {
             this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.element);
-            this.splitView.mainElement().appendChild(this._debugSidebarResizeWidgetElement);
+            this._splitView.mainElement().appendChild(this._debugSidebarResizeWidgetElement);
         } else {
             this._statusBarContainerElement.appendChild(this._debugSidebarResizeWidgetElement);
             this._statusBarContainerElement.appendChild(this._toggleDebuggerSidebarButton.element);
@@ -1328,7 +1310,15 @@ WebInspector.SourcesPanel.prototype = {
         /**
          * @this {WebInspector.SourcesPanel}
          */
-        function clickHandler()
+        function navigatorHandler()
+        {
+            this._enableNavigatorSidebar(this._toggleNavigatorSidebarButton.state === "right");
+        }
+
+        /**
+         * @this {WebInspector.SourcesPanel}
+         */
+        function debuggerHandler()
         {
             this._enableDebuggerSidebar(this._toggleDebuggerSidebarButton.state === "left");
         }
@@ -1337,14 +1327,28 @@ WebInspector.SourcesPanel.prototype = {
     /**
      * @param {boolean} show
      */
+    _enableNavigatorSidebar: function(show)
+    {
+        this._toggleNavigatorSidebarButton.state = show ? "left" : "right";
+        this._toggleNavigatorSidebarButton.title = show ? WebInspector.UIString("Hide navigator") : WebInspector.UIString("Show navigator");
+        if (show)
+            this.editorView.showBoth(true);
+        else
+            this.editorView.hideSidebar(true);
+        WebInspector.settings.navigatorHidden.set(!show);
+    },
+
+    /**
+     * @param {boolean} show
+     */
     _enableDebuggerSidebar: function(show)
     {
         this._toggleDebuggerSidebarButton.state = show ? "right" : "left";
         this._toggleDebuggerSidebarButton.title = show ? WebInspector.UIString("Hide debugger") : WebInspector.UIString("Show debugger");
         if (show)
-            this.splitView.showSidebarElement();
+            this._splitView.showBoth(true);
         else
-            this.splitView.hideSidebarElement();
+            this._splitView.hideSidebar(true);
         this._debugSidebarResizeWidgetElement.enableStyleClass("hidden", !show);
         WebInspector.settings.debuggerSidebarHidden.set(!show);
     },
@@ -1358,7 +1362,6 @@ WebInspector.SourcesPanel.prototype = {
         var path = event.data.path;
         var uiSourceCodeToCopy = event.data.uiSourceCode;
         var filePath;
-        var shouldHideNavigator;
         var uiSourceCode;
 
         /**
@@ -1395,10 +1398,6 @@ WebInspector.SourcesPanel.prototype = {
             filePath = path;
             uiSourceCode = project.uiSourceCode(filePath);
             this._showSourceLocation(uiSourceCode);
-
-            shouldHideNavigator = !this._navigatorController.isNavigatorPinned();
-            if (this._navigatorController.isNavigatorHidden())
-                this._navigatorController.showNavigatorOverlay();
             this._navigator.rename(uiSourceCode, callback.bind(this));
         }
 
@@ -1408,9 +1407,6 @@ WebInspector.SourcesPanel.prototype = {
          */
         function callback(committed)
         {
-            if (shouldHideNavigator)
-                this._navigatorController.hideNavigatorOverlay();
-
             if (!committed) {
                 project.deleteFile(uiSourceCode);
                 return;
@@ -1428,10 +1424,6 @@ WebInspector.SourcesPanel.prototype = {
     _itemRenamingRequested: function(event)
     {
         var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (event.data);
-
-        var shouldHideNavigator = !this._navigatorController.isNavigatorPinned();
-        if (this._navigatorController.isNavigatorHidden())
-            this._navigatorController.showNavigatorOverlay();
         this._navigator.rename(uiSourceCode, callback.bind(this));
 
         /**
@@ -1440,8 +1432,6 @@ WebInspector.SourcesPanel.prototype = {
          */
         function callback(committed)
         {
-            if (shouldHideNavigator && committed)
-                this._navigatorController.hideNavigatorOverlay();
             this._recreateSourceFrameIfNeeded(uiSourceCode);
             this._navigator.updateIcon(uiSourceCode);
             this._showSourceLocation(uiSourceCode);
@@ -1550,9 +1540,7 @@ WebInspector.SourcesPanel.prototype = {
 
         var uiSourceCode = /** @type {!WebInspector.UISourceCode} */ (target);
         contextMenu.appendItem(WebInspector.UIString(WebInspector.useLowerCaseMenuTitles() ? "Local modifications\u2026" : "Local Modifications\u2026"), this._showLocalHistory.bind(this, uiSourceCode));
-
-        if (WebInspector.isolatedFileSystemManager.supportsFileSystems())
-            this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
+        this._appendUISourceCodeMappingItems(contextMenu, uiSourceCode);
     },
 
     /**
@@ -1618,27 +1606,28 @@ WebInspector.SourcesPanel.prototype = {
      */
     _splitVertically: function(vertically)
     {
-        if (this.sidebarPaneView && vertically === !this.splitView.isVertical())
+        if (this.sidebarPaneView && vertically === !this._splitView.isVertical())
             return;
 
         if (this.sidebarPaneView)
             this.sidebarPaneView.detach();
 
-        this.splitView.setVertical(!vertically);
+        this._splitView.setVertical(!vertically);
 
         // Update resizer widgets.
         if (!vertically) {
-            this.splitView.uninstallResizer(this._statusBarContainerElement);
+            this._splitView.uninstallResizer(this._statusBarContainerElement);
             this.editorView.element.appendChild(this._toggleDebuggerSidebarButton.element);
-            this.splitView.mainElement().appendChild(this._debugSidebarResizeWidgetElement);
+            this._splitView.mainElement().appendChild(this._debugSidebarResizeWidgetElement);
         } else {
-            this.splitView.installResizer(this._statusBarContainerElement);
+            this._splitView.installResizer(this._statusBarContainerElement);
             this._statusBarContainerElement.appendChild(this._debugSidebarResizeWidgetElement);
             this._statusBarContainerElement.appendChild(this._toggleDebuggerSidebarButton.element)
         }
 
         // Create vertical box with stack.
         var vbox = new WebInspector.View();
+        vbox.element.appendChild(this._debugToolbarDrawer);
         vbox.element.appendChild(this.debugToolbar);
         vbox.element.appendChild(this.threadsToolbar.element);
         var sidebarPaneStack = new WebInspector.SidebarPaneStack();
@@ -1653,8 +1642,9 @@ WebInspector.SourcesPanel.prototype = {
 
             this.sidebarPaneView = vbox;
         } else {
-            var splitView = new WebInspector.SplitView(true, this.name + "PanelSplitSidebarRatio", 0.5);
-            splitView.setFirstView(vbox);
+            var splitView = new WebInspector.SplitView(true, true, this.name + "PanelSplitSidebarRatio", 0.5);
+            splitView.setMainElementConstraints(WebInspector.SourcesPanel.minToolbarWidth, 25);
+            vbox.show(splitView.mainElement());
 
             // Populate the left stack.
             sidebarPaneStack.addPane(this.sidebarPanes.callstack);
@@ -1666,7 +1656,7 @@ WebInspector.SourcesPanel.prototype = {
                 sidebarPaneStack.addPane(this.sidebarPanes.workerList);
 
             var tabbedPane = new WebInspector.SidebarTabbedPane();
-            splitView.setSecondView(tabbedPane);
+            tabbedPane.show(splitView.sidebarElement());
             tabbedPane.addPane(this.sidebarPanes.scopechain);
             tabbedPane.addPane(this.sidebarPanes.watchExpressions);
             this._extensionSidebarPanesContainer = tabbedPane;
@@ -1676,7 +1666,7 @@ WebInspector.SourcesPanel.prototype = {
         for (var i = 0; i < this._extensionSidebarPanes.length; ++i)
             this._extensionSidebarPanesContainer.addPane(this._extensionSidebarPanes[i]);
 
-        this.splitView.setSidebarView(this.sidebarPaneView);
+        this.sidebarPaneView.show(this._splitView.sidebarElement());
 
         this.sidebarPanes.scopechain.expand();
         this.sidebarPanes.jsBreakpoints.expand();
@@ -1840,6 +1830,6 @@ WebInspector.SourcesPanel.UILocationRevealer.prototype = {
     reveal: function(uiLocation)
     {
         if (uiLocation instanceof WebInspector.UILocation)
-            /** @type {!WebInspector.SourcesPanel} */ (WebInspector.showPanel("sources")).showUILocation(uiLocation);
+            /** @type {!WebInspector.SourcesPanel} */ (WebInspector.panel("sources")).showUILocation(uiLocation);
     }
 }