Title: [107384] trunk/Source/WebCore
Revision
107384
Author
vse...@chromium.org
Date
2012-02-10 01:34:33 -0800 (Fri, 10 Feb 2012)

Log Message

Web Inspector: FileSelector should not depend on DebuggerPresentationModel.
https://bugs.webkit.org/show_bug.cgi?id=78337

Reviewed by Pavel Feldman.

* inspector/front-end/ScriptsNavigator.js:
(WebInspector.ScriptsNavigator):
(WebInspector.ScriptsNavigator.prototype._showScriptFoldersSettingChanged):
(WebInspector.ScriptsNavigator.prototype.reset):
* inspector/front-end/ScriptsPanel.js:
(WebInspector.ScriptsPanel.prototype._reset):
(WebInspector.ScriptsPanel.FileSelector.prototype.replaceUISourceCodes):
(WebInspector.ScriptsPanel.FileSelector.prototype.reset):
(WebInspector.ScriptsPanel.ComboBoxFileSelector):
(WebInspector.ScriptsPanel.ComboBoxFileSelector.prototype.reset):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (107383 => 107384)


--- trunk/Source/WebCore/ChangeLog	2012-02-10 09:29:43 UTC (rev 107383)
+++ trunk/Source/WebCore/ChangeLog	2012-02-10 09:34:33 UTC (rev 107384)
@@ -1,3 +1,21 @@
+2012-02-10  Vsevolod Vlasov  <vse...@chromium.org>
+
+        Web Inspector: FileSelector should not depend on DebuggerPresentationModel.
+        https://bugs.webkit.org/show_bug.cgi?id=78337
+
+        Reviewed by Pavel Feldman.
+
+        * inspector/front-end/ScriptsNavigator.js:
+        (WebInspector.ScriptsNavigator):
+        (WebInspector.ScriptsNavigator.prototype._showScriptFoldersSettingChanged):
+        (WebInspector.ScriptsNavigator.prototype.reset):
+        * inspector/front-end/ScriptsPanel.js:
+        (WebInspector.ScriptsPanel.prototype._reset):
+        (WebInspector.ScriptsPanel.FileSelector.prototype.replaceUISourceCodes):
+        (WebInspector.ScriptsPanel.FileSelector.prototype.reset):
+        (WebInspector.ScriptsPanel.ComboBoxFileSelector):
+        (WebInspector.ScriptsPanel.ComboBoxFileSelector.prototype.reset):
+
 2012-02-10  Kentaro Hara  <hara...@chromium.org>
 
         Remove [ConvertingNullStringTo] from CloseEvent.idl

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js (107383 => 107384)


--- trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js	2012-02-10 09:29:43 UTC (rev 107383)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js	2012-02-10 09:34:33 UTC (rev 107384)
@@ -31,15 +31,13 @@
  * @extends {WebInspector.Object}
  * @constructor
  */
-WebInspector.ScriptsNavigator = function(presentationModel)
+WebInspector.ScriptsNavigator = function()
 {
     WebInspector.Object.call(this);
     
     this._tabbedPane = new WebInspector.TabbedPane();
     this._tabbedPane.shrinkableTabs = true;
 
-    this._presentationModel = presentationModel;
-
     this._tabbedPane.element.id = "scripts-navigator-tabbed-pane";
     
     this._tabbedPane.element.tabIndex = 0;
@@ -71,9 +69,6 @@
     this._scriptTreeElementsByUISourceCode = new Map();
     
     WebInspector.settings.showScriptFolders.addChangeListener(this._showScriptFoldersSettingChanged.bind(this));
-    
-    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._reset, this);
-    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.DebuggerReset, this._reset, this);
 }
 
 WebInspector.ScriptsNavigator.ScriptsTab = "scripts";
@@ -228,14 +223,14 @@
     {
         var uiSourceCodes = this._navigatorScriptsTree.scriptTreeElements();
         uiSourceCodes = uiSourceCodes.concat(this._navigatorContentScriptsTree.scriptTreeElements());
-        this._reset();
+        this.reset();
         for (var i = 0; i < uiSourceCodes.length; ++i)
             this.addUISourceCode(uiSourceCodes[i]);
         
         this.revealUISourceCode(this._lastSelectedUISourceCode);
     },
     
-    _reset: function()
+    reset: function()
     {
         this._navigatorScriptsTree.stopSearch();
         this._navigatorScriptsTree.removeChildren();

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js (107383 => 107384)


--- trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-02-10 09:29:43 UTC (rev 107383)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js	2012-02-10 09:34:33 UTC (rev 107384)
@@ -70,7 +70,7 @@
         this.editorView.minimalMainWidthPercent = minimalViewsContainerWidthPercent;
         this.editorView.show(this.splitView.mainElement);
 
-        this._navigator = new WebInspector.ScriptsNavigator(this._presentationModel);
+        this._navigator = new WebInspector.ScriptsNavigator();
         this._navigatorView = this._navigator.view;
         this._fileSelector = this._navigator;
         this._fileSelector.show(this.editorView.sidebarElement);
@@ -85,7 +85,7 @@
         if (WebInspector.settings.navigatorHidden.get())
             this._toggleNavigator();
     } else {
-        this._fileSelector = new WebInspector.ScriptsPanel.ComboBoxFileSelector(this._presentationModel);
+        this._fileSelector = new WebInspector.ScriptsPanel.ComboBoxFileSelector();
         this._fileSelector.show(this.splitView.mainElement);
 
         this._editorContainer = new WebInspector.ScriptsPanel.SingleFileEditorContainer(this);
@@ -408,6 +408,7 @@
         this._debuggerResumed();
 
         delete this._currentUISourceCode;
+        this._fileSelector.reset();
         this._editorContainer.reset();
         this._updateScriptViewStatusBarItems();
 
@@ -1174,7 +1175,9 @@
      * @param {Array.<WebInspector.UISourceCode>} oldUISourceCodeList
      * @param {Array.<WebInspector.UISourceCode>} uiSourceCodeList
      */
-    replaceUISourceCodes: function(oldUISourceCodeList, uiSourceCodeList) { }
+    replaceUISourceCodes: function(oldUISourceCodeList, uiSourceCodeList) { },
+    
+    reset: function() { }
 }
 
 /**
@@ -1241,15 +1244,12 @@
  * @extends {WebInspector.Object}
  * @constructor
  */
-WebInspector.ScriptsPanel.ComboBoxFileSelector = function(presentationModel)
+WebInspector.ScriptsPanel.ComboBoxFileSelector = function()
 {
     WebInspector.Object.call(this);
     this.editorToolbar = this._createEditorToolbar();
     
-    this._presentationModel = presentationModel;
     WebInspector.settings.showScriptFolders.addChangeListener(this._showScriptFoldersSettingChanged.bind(this));
-    WebInspector.debuggerModel.addEventListener(WebInspector.DebuggerModel.Events.DebuggerWasDisabled, this._reset, this);
-    this._presentationModel.addEventListener(WebInspector.DebuggerPresentationModel.Events.DebuggerReset, this._reset, this);
     
     this._backForwardList = [];
 }
@@ -1387,7 +1387,7 @@
         }
     },
     
-    _reset: function()
+    reset: function()
     {
         this._backForwardList = [];
         this._currentBackForwardIndex = -1;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to