Make the Inspector correctly populate the profiles when
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 May 2008 09:41:52 +0000 (09:41 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 May 2008 09:41:52 +0000 (09:41 +0000)
closed and re-opened.

Reviewed by Adam Roben.

* page/InspectorController.cpp:
(WebCore::InspectorController::populateScriptObjects): Call populateInterface
in inspector.js.
* page/inspector/ProfilesPanel.js:
(WebInspector.ProfilesPanel.prototype.populateInterface): If visible,
call _populateProfiles. Else just set this._shouldPopulateProfiles to true.
(WebInspector.ProfilesPanel.prototype.reset): Don't call _populateProfiles.
Just set this._shouldPopulateProfiles to true.
(WebInspector.ProfilesPanel.prototype._populateProfiles): Delete
this._shouldPopulateProfiles.
* page/inspector/inspector.js:
(WebInspector.populateInterface): Added. Call populateInterface on all the
panels if they implement it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34070 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/page/InspectorController.cpp
WebCore/page/inspector/ProfilesPanel.js
WebCore/page/inspector/inspector.js

index b64c5cf..a8a728c 100644 (file)
@@ -1,3 +1,24 @@
+2008-05-23  Timothy Hatcher  <timothy@apple.com>
+
+        Make the Inspector correctly populate the profiles when
+        closed and re-opened.
+
+        Reviewed by Adam Roben.
+
+        * page/InspectorController.cpp:
+        (WebCore::InspectorController::populateScriptObjects): Call populateInterface
+        in inspector.js.
+        * page/inspector/ProfilesPanel.js:
+        (WebInspector.ProfilesPanel.prototype.populateInterface): If visible,
+        call _populateProfiles. Else just set this._shouldPopulateProfiles to true.
+        (WebInspector.ProfilesPanel.prototype.reset): Don't call _populateProfiles.
+        Just set this._shouldPopulateProfiles to true.
+        (WebInspector.ProfilesPanel.prototype._populateProfiles): Delete
+        this._shouldPopulateProfiles.
+        * page/inspector/inspector.js:
+        (WebInspector.populateInterface): Added. Call populateInterface on all the
+        panels if they implement it.
+
 2008-05-23  Kevin McCullough  <kmccullough@apple.com>
 
         RS = Adam.
index 56165c8..955e7f3 100644 (file)
@@ -1738,6 +1738,8 @@ void InspectorController::populateScriptObjects()
     for (DatabaseResourcesSet::iterator it = m_databaseResources.begin(); it != databasesEnd; ++it)
         addDatabaseScriptResource((*it).get());
 #endif
+
+    callSimpleFunction(m_scriptContext, m_scriptObject, "populateInterface");
 }
 
 #if ENABLE(DATABASE)
index 91a48ab..453b31d 100644 (file)
@@ -80,11 +80,16 @@ WebInspector.ProfilesPanel.prototype = {
     {
         WebInspector.Panel.prototype.show.call(this);
         this._updateSidebarWidth();
+        if (this._shouldPopulateProfiles)
+            this._populateProfiles();
+    },
 
-        if (this._shouldPopulateProfiles) {
+    populateInterface: function()
+    {
+        if (this.visible)
             this._populateProfiles();
-            delete this._shouldPopulateProfiles;
-        }
+        else
+            this._shouldPopulateProfiles = true;
     },
 
     reset: function()
@@ -104,10 +109,7 @@ WebInspector.ProfilesPanel.prototype = {
         this.sidebarTree.removeChildren();
         this.profileViews.removeChildren();
 
-        if (this.visible)
-            this._populateProfiles();
-        else
-            this._shouldPopulateProfiles = true;
+        this._shouldPopulateProfiles = true;
     },
 
     handleKeyEvent: function(event)
@@ -185,6 +187,8 @@ WebInspector.ProfilesPanel.prototype = {
 
         if (this.sidebarTree.children[0])
             this.sidebarTree.children[0].select();
+
+        delete this._shouldPopulateProfiles;
     },
 
     _startSidebarDragging: function(event)
index d6d235d..39e635e 100644 (file)
@@ -776,6 +776,15 @@ WebInspector.pausedScript = function()
     this.panels.scripts.debuggerPaused();
 }
 
+WebInspector.populateInterface = function()
+{
+    for (var panelName in this.panels) {
+        var panel = this.panels[panelName];
+        if ("populateInterface" in panel)
+            panel.populateInterface();
+    }
+}
+
 WebInspector.reset = function()
 {
     for (var panelName in this.panels) {