[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

loislo at chromium.org loislo at chromium.org
Wed Dec 22 11:50:05 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit acb548e8bc8abaa405557882efc6483576321376
Author: loislo at chromium.org <loislo at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 9 11:26:02 2010 +0000

    2010-08-09  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            WebInspector: Current implementation of showPanel is a bit complicated.
            It is using internal enum for all the panels and this is the problem because
            we should change a lot of code for a new panel.
            https://bugs.webkit.org/show_bug.cgi?id=43711
    
            * WebCore.exp.in:
            * inspector/Inspector.idl:
            * inspector/InspectorController.cpp:
            (WebCore::InspectorController::InspectorController):
            (WebCore::InspectorController::storeLastActivePanel):
            (WebCore::InspectorController::connectFrontend):
            (WebCore::InspectorController::showPanel):
            (WebCore::InspectorController::disconnectFrontend):
            * inspector/InspectorController.h:
            * inspector/InspectorFrontend.cpp:
            * inspector/InspectorFrontend.h:
            * inspector/front-end/ElementsTreeOutline.js:
            (WebInspector.ElementsTreeElement.prototype.selectOnMouseDown):
            * inspector/front-end/ExtensionServer.js:
            (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
            * inspector/front-end/inspector.js:
            (WebInspector.documentClick.followLink):
            (WebInspector.documentClick):
            (WebInspector.toggleSearchingForNode):
            (WebInspector.showPanel):
            (WebInspector.selectDatabase):
            (WebInspector.selectDOMStorage):
            (WebInspector.showProfileForURL):
    
    2010-08-09  Ilya Tikhonovsky  <loislo at chromium.org>
    
            Reviewed by Yury Semikhatsky.
    
            WebInspector: Current implementation of showPanel is a bit complicated.
            It is using internal enum for all the panels and this is the problem because
            we should change a lot of code for a new panel.
            https://bugs.webkit.org/show_bug.cgi?id=43711
    
            * inspector/debugger-breakpoints-not-activated-on-reload.html:
            * inspector/debugger-cyclic-ref.html:
            * inspector/debugger-eval-while-paused.html:
            * inspector/debugger-no-nested-pause.html:
            * inspector/debugger-pause-in-eval-script.html:
            * inspector/debugger-pause-on-debugger-statement.html:
            * inspector/debugger-proto-property.html:
            * inspector/elements-panel-limited-children.html:
    
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64973 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 03784ef..aee39e9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-09  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        WebInspector: Current implementation of showPanel is a bit complicated.
+        It is using internal enum for all the panels and this is the problem because
+        we should change a lot of code for a new panel.
+        https://bugs.webkit.org/show_bug.cgi?id=43711
+
+        * inspector/debugger-breakpoints-not-activated-on-reload.html:
+        * inspector/debugger-cyclic-ref.html:
+        * inspector/debugger-eval-while-paused.html:
+        * inspector/debugger-no-nested-pause.html:
+        * inspector/debugger-pause-in-eval-script.html:
+        * inspector/debugger-pause-on-debugger-statement.html:
+        * inspector/debugger-proto-property.html:
+        * inspector/elements-panel-limited-children.html:
+
 2010-08-09  Shinichiro Hamaji  <hamaji at chromium.org>
 
         Update chromium's expectation.
diff --git a/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html b/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
index c8718d8..562769c 100644
--- a/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
+++ b/LayoutTests/inspector/debugger-breakpoints-not-activated-on-reload.html
@@ -21,7 +21,7 @@ function frontend_testBreakpointsNotActivatedOnReload(testController)
 
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
     frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
 
     function debuggerWasEnabledCallback()
diff --git a/LayoutTests/inspector/debugger-cyclic-ref.html b/LayoutTests/inspector/debugger-cyclic-ref.html
index fc82943..b3fa660 100755
--- a/LayoutTests/inspector/debugger-cyclic-ref.html
+++ b/LayoutTests/inspector/debugger-cyclic-ref.html
@@ -21,7 +21,7 @@ function frontend_testDebugObjectWithCyclicRef(testController)
 {
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
     frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
 
     function debuggerWasEnabledCallback()
diff --git a/LayoutTests/inspector/debugger-eval-while-paused.html b/LayoutTests/inspector/debugger-eval-while-paused.html
index 2d4a504..23eaad8 100644
--- a/LayoutTests/inspector/debugger-eval-while-paused.html
+++ b/LayoutTests/inspector/debugger-eval-while-paused.html
@@ -25,7 +25,7 @@ function frontend_testPauseOnDebuggerStatement(testController)
 {
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
     frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
 
     function debuggerWasEnabledCallback()
diff --git a/LayoutTests/inspector/debugger-no-nested-pause.html b/LayoutTests/inspector/debugger-no-nested-pause.html
index 1f35ba5..f183105 100644
--- a/LayoutTests/inspector/debugger-no-nested-pause.html
+++ b/LayoutTests/inspector/debugger-no-nested-pause.html
@@ -20,7 +20,7 @@ function frontend_testNoNestedPause(testController)
 {
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
     frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
 
     function debuggerWasEnabledCallback()
diff --git a/LayoutTests/inspector/debugger-pause-in-eval-script.html b/LayoutTests/inspector/debugger-pause-in-eval-script.html
index 2af013c..cae2a94 100644
--- a/LayoutTests/inspector/debugger-pause-in-eval-script.html
+++ b/LayoutTests/inspector/debugger-pause-in-eval-script.html
@@ -13,7 +13,7 @@ function frontend_testPauseOnDebuggerStatement(testController)
 {
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
 
     var scriptToEvaluate = "function testFunction() {\n" +
                            "    debugger;\n" +
diff --git a/LayoutTests/inspector/debugger-pause-on-debugger-statement.html b/LayoutTests/inspector/debugger-pause-on-debugger-statement.html
index 1ea6d7c..242c287 100644
--- a/LayoutTests/inspector/debugger-pause-on-debugger-statement.html
+++ b/LayoutTests/inspector/debugger-pause-on-debugger-statement.html
@@ -17,7 +17,7 @@ function frontend_testPauseOnDebuggerStatement(testController)
 {
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
     frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
 
     function debuggerWasEnabledCallback()
diff --git a/LayoutTests/inspector/debugger-proto-property.html b/LayoutTests/inspector/debugger-proto-property.html
index 86a7d28..4d11b00 100644
--- a/LayoutTests/inspector/debugger-proto-property.html
+++ b/LayoutTests/inspector/debugger-proto-property.html
@@ -25,7 +25,7 @@ function frontend_testProtoPropertyOnPause(testController)
 {
     testController.waitUntilDone();
 
-    WebInspector.showScriptsPanel();
+    WebInspector.showPanel("scripts");
     frontend_ensureDebuggerEnabled(debuggerWasEnabledCallback);
 
     function debuggerWasEnabledCallback()
diff --git a/LayoutTests/inspector/elements-panel-limited-children.html b/LayoutTests/inspector/elements-panel-limited-children.html
index 5cd0970..bb3035e 100644
--- a/LayoutTests/inspector/elements-panel-limited-children.html
+++ b/LayoutTests/inspector/elements-panel-limited-children.html
@@ -125,6 +125,7 @@ function frontend_revealAndExpandDataNodeInElementsPanel(testController)
 
 function frontend_loadDOM(testController)
 {
+    WebInspector.showPanel("elements");
     testController.waitUntilDone();
     // Need test to be async to expand whole the tree first.
     try {
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3750784..ef2b2c9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,36 @@
+2010-08-09  Ilya Tikhonovsky  <loislo at chromium.org>
+
+        Reviewed by Yury Semikhatsky.
+
+        WebInspector: Current implementation of showPanel is a bit complicated.
+        It is using internal enum for all the panels and this is the problem because
+        we should change a lot of code for a new panel.
+        https://bugs.webkit.org/show_bug.cgi?id=43711
+
+        * WebCore.exp.in:
+        * inspector/Inspector.idl:
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::InspectorController):
+        (WebCore::InspectorController::storeLastActivePanel):
+        (WebCore::InspectorController::connectFrontend):
+        (WebCore::InspectorController::showPanel):
+        (WebCore::InspectorController::disconnectFrontend):
+        * inspector/InspectorController.h:
+        * inspector/InspectorFrontend.cpp:
+        * inspector/InspectorFrontend.h:
+        * inspector/front-end/ElementsTreeOutline.js:
+        (WebInspector.ElementsTreeElement.prototype.selectOnMouseDown):
+        * inspector/front-end/ExtensionServer.js:
+        (WebInspector.ExtensionServer.prototype._onRevealAndSelectResource):
+        * inspector/front-end/inspector.js:
+        (WebInspector.documentClick.followLink):
+        (WebInspector.documentClick):
+        (WebInspector.toggleSearchingForNode):
+        (WebInspector.showPanel):
+        (WebInspector.selectDatabase):
+        (WebInspector.selectDOMStorage):
+        (WebInspector.showProfileForURL):
+
 2010-08-09  Ariya Hidayat  <ariya at sencha.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 0ba2cfd..f4978bd 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -422,7 +422,11 @@ __ZN7WebCore19AnimationController20pauseAnimationAtTimeEPNS_12RenderObjectERKNS_
 __ZN7WebCore19AnimationController21pauseTransitionAtTimeEPNS_12RenderObjectERKNS_6StringEd
 __ZN7WebCore19BackForwardListImplC1EPNS_4PageE
 __ZN7WebCore19CSSStyleDeclaration11setPropertyERKNS_6StringES3_Ri
+__ZN7WebCore19InspectorController12ConsolePanelE
+__ZN7WebCore19InspectorController12ScriptsPanelE
+__ZN7WebCore19InspectorController13ProfilesPanelE
 __ZN7WebCore19InspectorController34inspectorStartsAttachedSettingNameEv
+__ZN7WebCore19InspectorController9showPanelERKNS_6StringE
 __ZN7WebCore19ResourceRequestBase11setHTTPBodyEN3WTF10PassRefPtrINS_8FormDataEEE
 __ZN7WebCore19ResourceRequestBase13setHTTPMethodERKNS_6StringE
 __ZN7WebCore19ResourceRequestBase19addHTTPHeaderFieldsERKNS_13HTTPHeaderMapE
@@ -1200,7 +1204,6 @@ __ZN7WebCore19InspectorController27startUserInitiatedProfilingEPNS_5TimerIS0_EE
 __ZN7WebCore19InspectorController4showEv
 __ZN7WebCore19InspectorController5closeEv
 __ZN7WebCore19InspectorController7inspectEPNS_4NodeE
-__ZN7WebCore19InspectorController9showPanelENS0_13SpecialPanelsE
 __ZN7WebCore28InspectorFrontendClientLocal12moveWindowByEff
 __ZN7WebCore28InspectorFrontendClientLocal14frontendLoadedEv
 __ZN7WebCore28InspectorFrontendClientLocal15canAttachWindowEv
diff --git a/WebCore/inspector/Inspector.idl b/WebCore/inspector/Inspector.idl
index 8d110ad..4f643a2 100644
--- a/WebCore/inspector/Inspector.idl
+++ b/WebCore/inspector/Inspector.idl
@@ -60,6 +60,7 @@ module core {
         [notify] void setChildNodes(out long parentId, out Array nodes);
         [notify] void setDetachedRoot(out Object root);
         [notify] void setDocument(out Value root);
+        [notify] void showPanel(out String panel);
         [notify] void timelineProfilerWasStarted();
         [notify] void timelineProfilerWasStopped();
         [notify] void updateConsoleMessageExpiredCount(out unsigned long count);
diff --git a/WebCore/inspector/InspectorController.cpp b/WebCore/inspector/InspectorController.cpp
index 68fcaec..57d6fe1 100644
--- a/WebCore/inspector/InspectorController.cpp
+++ b/WebCore/inspector/InspectorController.cpp
@@ -119,7 +119,12 @@ static const char* const resourceTrackingEnabledSettingName = "resourceTrackingE
 static const char* const debuggerEnabledSettingName = "debuggerEnabled";
 static const char* const profilerEnabledSettingName = "profilerEnabled";
 static const char* const inspectorAttachedHeightName = "inspectorAttachedHeight";
-static const char* const lastActivePanelSettingName = "lastActivePanel";
+static const char* const lastActivePanel = "lastActivePanel";
+const char* const InspectorController::ElementsPanel = "elements";
+const char* const InspectorController::ConsolePanel = "console";
+const char* const InspectorController::ScriptsPanel = "scripts";
+const char* const InspectorController::ProfilesPanel = "profiles";
+
 static const char* const monitoringXHRSettingName = "xhrMonitor";
 
 int connectedFrontendCount = 0;
@@ -150,7 +155,7 @@ InspectorController::InspectorController(Page* page, InspectorClient* client)
     , m_openingFrontend(false)
     , m_cssStore(new InspectorCSSStore(this))
     , m_expiredConsoleMessageCount(0)
-    , m_showAfterVisible(CurrentPanel)
+    , m_showAfterVisible(lastActivePanel)
     , m_sessionSettings(InspectorObject::create())
     , m_groupLevel(0)
     , m_searchingForNode(false)
@@ -381,7 +386,7 @@ void InspectorController::markTimeline(const String& message)
 
 void InspectorController::storeLastActivePanel(const String& panelName)
 {
-    setSetting(lastActivePanelSettingName, panelName);
+    setSetting(lastActivePanel, panelName);
 }
 
 void InspectorController::mouseDidMoveOverElement(const HitTestResult& result, unsigned)
@@ -497,10 +502,8 @@ void InspectorController::connectFrontend(const ScriptObject& webInspector)
     }
 #endif
 
-    if (m_showAfterVisible == CurrentPanel) {
-        String lastActivePanelSetting = setting(lastActivePanelSettingName);
-        m_showAfterVisible = specialPanelForJSName(lastActivePanelSetting);
-    }
+    if (m_showAfterVisible == lastActivePanel)
+        m_showAfterVisible = setting(lastActivePanel);
 
     if (m_nodeToFocus)
         focusNode();
@@ -531,7 +534,7 @@ void InspectorController::show()
     }
 }
 
-void InspectorController::showPanel(SpecialPanels panel)
+void InspectorController::showPanel(const String& panel)
 {
     if (!enabled())
         return;
@@ -543,10 +546,10 @@ void InspectorController::showPanel(SpecialPanels panel)
         return;
     }
 
-    if (panel == CurrentPanel)
+    if (panel == lastActivePanel)
         return;
 
-    m_frontend->showPanel(panel);
+    m_remoteFrontend->showPanel(panel);
 }
 
 void InspectorController::close()
@@ -579,7 +582,7 @@ void InspectorController::disconnectFrontend()
     unbindAllResources();
     stopTimelineProfiler();
 
-    m_showAfterVisible = CurrentPanel;
+    m_showAfterVisible = lastActivePanel;
 
     hideHighlight();
 
@@ -1892,27 +1895,6 @@ bool InspectorController::stopTiming(const String& title, double& elapsed)
     return true;
 }
 
-InspectorController::SpecialPanels InspectorController::specialPanelForJSName(const String& panelName)
-{
-    if (panelName == "elements")
-        return ElementsPanel;
-    if (panelName == "resources")
-        return ResourcesPanel;
-    if (panelName == "scripts")
-        return ScriptsPanel;
-    if (panelName == "timeline")
-        return TimelinePanel;
-    if (panelName == "profiles")
-        return ProfilesPanel;
-    if (panelName == "storage" || panelName == "databases")
-        return StoragePanel;
-    if (panelName == "audits")
-        return AuditsPanel;
-    if (panelName == "console")
-        return ConsolePanel;
-    return ElementsPanel;
-}
-
 InjectedScript InspectorController::injectedScriptForNodeId(long id)
 {
 
diff --git a/WebCore/inspector/InspectorController.h b/WebCore/inspector/InspectorController.h
index 8dbab6a..15687d1 100644
--- a/WebCore/inspector/InspectorController.h
+++ b/WebCore/inspector/InspectorController.h
@@ -94,17 +94,10 @@ public:
     typedef HashMap<int, RefPtr<InspectorDatabaseResource> > DatabaseResourcesMap;
     typedef HashMap<int, RefPtr<InspectorDOMStorageResource> > DOMStorageResourcesMap;
 
-    typedef enum {
-        AuditsPanel,
-        CurrentPanel,
-        ConsolePanel,
-        ElementsPanel,
-        ResourcesPanel,
-        ScriptsPanel,
-        TimelinePanel,
-        ProfilesPanel,
-        StoragePanel
-    } SpecialPanels;
+    static const char* const ConsolePanel;
+    static const char* const ElementsPanel;
+    static const char* const ProfilesPanel;
+    static const char* const ScriptsPanel;
 
     InspectorController(Page*, InspectorClient*);
     ~InspectorController();
@@ -134,7 +127,7 @@ public:
     void hideDOMNodeHighlight() { hideHighlight(); }
 
     void show();
-    void showPanel(SpecialPanels);
+    void showPanel(const String&);
     void close();
 
     // We are in transition from JS transport via webInspector to native
@@ -323,8 +316,6 @@ private:
 
     bool isMainResourceLoader(DocumentLoader* loader, const KURL& requestUrl);
 
-    SpecialPanels specialPanelForJSName(const String& panelName);
-
     void didEvaluateForTestInFrontend(long callId, const String& jsonResult);
 
 #if ENABLE(JAVASCRIPT_DEBUGGER)
@@ -363,7 +354,7 @@ private:
 #if ENABLE(DOM_STORAGE)
     DOMStorageResourcesMap m_domStorageResources;
 #endif
-    SpecialPanels m_showAfterVisible;
+    String m_showAfterVisible;
     RefPtr<Node> m_highlightedNode;
 #if ENABLE(INSPECTOR)
     RefPtr<InspectorValue> m_sessionSettings;
diff --git a/WebCore/inspector/InspectorFrontend.cpp b/WebCore/inspector/InspectorFrontend.cpp
index bc105d0..186a289 100644
--- a/WebCore/inspector/InspectorFrontend.cpp
+++ b/WebCore/inspector/InspectorFrontend.cpp
@@ -57,43 +57,6 @@ void InspectorFrontend::close()
     function.call();
 }
 
-void InspectorFrontend::showPanel(int panel)
-{
-    const char* showFunctionName;
-    switch (panel) {
-        case InspectorController::AuditsPanel:
-            showFunctionName = "showAuditsPanel";
-            break;
-        case InspectorController::ConsolePanel:
-            showFunctionName = "showConsolePanel";
-            break;
-        case InspectorController::ElementsPanel:
-            showFunctionName = "showElementsPanel";
-            break;
-        case InspectorController::ResourcesPanel:
-            showFunctionName = "showResourcesPanel";
-            break;
-        case InspectorController::TimelinePanel:
-            showFunctionName = "showTimelinePanel";
-            break;
-        case InspectorController::ProfilesPanel:
-            showFunctionName = "showProfilesPanel";
-            break;
-        case InspectorController::ScriptsPanel:
-            showFunctionName = "showScriptsPanel";
-            break;
-        case InspectorController::StoragePanel:
-            showFunctionName = "showStoragePanel";
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-            showFunctionName = 0;
-    }
-
-    if (showFunctionName)
-        callSimpleFunction(showFunctionName);
-}
-
 void InspectorFrontend::callSimpleFunction(const String& functionName)
 {
     ScriptFunctionCall function(m_webInspector, "dispatch");
diff --git a/WebCore/inspector/InspectorFrontend.h b/WebCore/inspector/InspectorFrontend.h
index 215796e..2f04ac2 100644
--- a/WebCore/inspector/InspectorFrontend.h
+++ b/WebCore/inspector/InspectorFrontend.h
@@ -47,7 +47,6 @@ namespace WebCore {
         ~InspectorFrontend();
 
         void close();
-        void showPanel(int panel);
         ScriptState* scriptState() const { return m_webInspector.scriptState(); }
     private:
         void callSimpleFunction(const String& functionName);
diff --git a/WebCore/inspector/front-end/ElementsTreeOutline.js b/WebCore/inspector/front-end/ElementsTreeOutline.js
index 3cd22ae..87d85c1 100644
--- a/WebCore/inspector/front-end/ElementsTreeOutline.js
+++ b/WebCore/inspector/front-end/ElementsTreeOutline.js
@@ -683,7 +683,7 @@ WebInspector.ElementsTreeElement.prototype = {
             return;
 
         if (this.treeOutline.showInElementsPanelEnabled) {
-            WebInspector.showElementsPanel();
+            WebInspector.showPanel("elements");
             WebInspector.panels.elements.focusedDOMNode = this.representedObject;
         }
 
diff --git a/WebCore/inspector/front-end/ExtensionServer.js b/WebCore/inspector/front-end/ExtensionServer.js
index 5b5a169..2abe1db 100644
--- a/WebCore/inspector/front-end/ExtensionServer.js
+++ b/WebCore/inspector/front-end/ExtensionServer.js
@@ -213,7 +213,7 @@ WebInspector.ExtensionServer.prototype = {
         if (!resource)
             return this._status.E_NOTFOUND(typeof id + ": " + id);
         WebInspector.panels.resources.showResource(resource, message.line);
-        WebInspector.showResourcesPanel();
+        WebInspector.showPanel("resources");
     },
 
     _dispatchCallback: function(requestId, port, result)
diff --git a/WebCore/inspector/front-end/inspector.js b/WebCore/inspector/front-end/inspector.js
index 8ebe23b..231e095 100644
--- a/WebCore/inspector/front-end/inspector.js
+++ b/WebCore/inspector/front-end/inspector.js
@@ -691,7 +691,7 @@ WebInspector.documentClick = function(event)
             return;
         }
 
-        WebInspector.showResourcesPanel();
+        WebInspector.showPanel("resources");
     }
 
     if (WebInspector.followLinkTimeout)
@@ -1081,7 +1081,7 @@ WebInspector.elementDragEnd = function(event)
 WebInspector.toggleSearchingForNode = function()
 {
     if (this.panels.elements) {
-        this.showElementsPanel();
+        this.showPanel("elements");
         this.panels.elements.toggleSearchingForNode();
     }
 }
@@ -1096,55 +1096,24 @@ WebInspector.showChanges = function()
     this.drawer.showView(this.changes);
 }
 
-WebInspector.showElementsPanel = function()
+WebInspector.showPanel = function(panel)
 {
-    this.currentPanel = this.panels.elements;
-}
-
-WebInspector.showResourcesPanel = function()
-{
-    this.currentPanel = this.panels.resources;
-}
-
-WebInspector.showScriptsPanel = function()
-{
-    this.currentPanel = this.panels.scripts;
-}
-
-WebInspector.showTimelinePanel = function()
-{
-    this.currentPanel = this.panels.timeline;
-}
-
-WebInspector.showProfilesPanel = function()
-{
-    this.currentPanel = this.panels.profiles;
-}
-
-WebInspector.showStoragePanel = function()
-{
-    this.currentPanel = this.panels.storage;
-}
-
-WebInspector.showConsolePanel = function()
-{
-    this.currentPanel = this.panels.console;
-}
-
-WebInspector.showAuditsPanel = function()
-{
-    this.currentPanel = this.panels.audits;
+    if (!(panel in this.panels)) {
+        console.error("Unable to show %s panel.", panel);
+        panel = "elements";
+    }
+    this.currentPanel = this.panels[panel];
 }
 
 WebInspector.selectDatabase = function(o)
 {
-    WebInspector.showStoragePanel();
+    WebInspector.showPanel("storage");
     WebInspector.panels.storage.selectDatabase(o);
 }
 
 WebInspector.selectDOMStorage = function(o)
 {
-    WebInspector.showStoragePanel();
+    WebInspector.showPanel("storage");
     WebInspector.panels.storage.selectDOMStorage(o);
 }
 
@@ -1742,7 +1711,7 @@ WebInspector.linkifyStringAsFragment = function(string)
 
 WebInspector.showProfileForURL = function(url)
 {
-    WebInspector.showProfilesPanel();
+    WebInspector.showPanel("profiles");
     WebInspector.panels.profiles.showProfileForURL(url);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list