Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / devtools / front_end / ResourcesPanel.js
index 122d791..b4448d0 100644 (file)
@@ -39,19 +39,17 @@ importScript("FileSystemView.js");
 
 /**
  * @constructor
- * @extends {WebInspector.Panel}
+ * @extends {WebInspector.PanelWithSidebarTree}
  */
 WebInspector.ResourcesPanel = function(database)
 {
-    WebInspector.Panel.call(this, "resources");
+    WebInspector.PanelWithSidebarTree.call(this, "resources");
     this.registerRequiredCSS("resourcesPanel.css");
 
     WebInspector.settings.resourcesLastSelectedItem = WebInspector.settings.createSetting("resourcesLastSelectedItem", {});
 
-    this.createSidebarViewWithTree();
-    this.splitView.sidebarElement().classList.add("outline-disclosure", "filter-all", "children", "small");
-
-    this.sidebarTreeElement.classList.remove("sidebar-tree");
+    this.sidebarElement().classList.add("filter-all", "children", "small", "outline-disclosure");
+    this.sidebarTree.element.classList.remove("sidebar-tree");
 
     this.resourcesListTreeElement = new WebInspector.StorageCategoryTreeElement(this, WebInspector.UIString("Frames"), "Frames", ["frame-storage-tree-item"]);
     this.sidebarTree.appendChild(this.resourcesListTreeElement);
@@ -79,11 +77,11 @@ WebInspector.ResourcesPanel = function(database)
         this.sidebarTree.appendChild(this.fileSystemListTreeElement);
     }
 
-    var mainElement = this.splitView.mainElement();
-    this.storageViews = mainElement.createChild("div", "resources-main");
-    var statusBarContainer = mainElement.createChild("div", "resources-status-bar");
+    var mainView = new WebInspector.View();
+    this.storageViews = mainView.element.createChild("div", "resources-main diff-container");
+    var statusBarContainer = mainView.element.createChild("div", "resources-status-bar");
     this.storageViewStatusBarItemsContainer = statusBarContainer.createChild("div", "status-bar");
-    this.storageViews.classList.add("diff-container");
+    mainView.show(this.mainElement());
 
     /** @type {!Map.<!WebInspector.Database, !Object.<string, !WebInspector.DatabaseTableView>>} */
     this._databaseTableViews = new Map();
@@ -100,8 +98,8 @@ WebInspector.ResourcesPanel = function(database)
     /** @type {!Object.<string, boolean>} */
     this._domains = {};
 
-    this.splitView.sidebarElement().addEventListener("mousemove", this._onmousemove.bind(this), false);
-    this.splitView.sidebarElement().addEventListener("mouseout", this._onmouseout.bind(this), false);
+    this.sidebarElement().addEventListener("mousemove", this._onmousemove.bind(this), false);
+    this.sidebarElement().addEventListener("mouseout", this._onmouseout.bind(this), false);
 
     /**
      * @return {!WebInspector.View}
@@ -413,20 +411,6 @@ WebInspector.ResourcesPanel.prototype = {
     },
 
     /**
-     * @param {!Element} anchor
-     * @return {boolean}
-     */
-    showAnchorLocation: function(anchor)
-    {
-        var resource = WebInspector.resourceForURL(anchor.href);
-        if (!resource)
-            return false;
-        WebInspector.inspectorView.setCurrentPanel(this);
-        this.showResource(resource, anchor.lineNumber);
-        return true;
-    },
-
-    /**
      * @param {!WebInspector.Resource} resource
      * @param {number=} line
      * @param {number=} column
@@ -777,7 +761,27 @@ WebInspector.ResourcesPanel.prototype = {
         }
     },
 
-    __proto__: WebInspector.Panel.prototype
+    __proto__: WebInspector.PanelWithSidebarTree.prototype
+}
+
+/**
+ * @constructor
+ * @implements {WebInspector.Revealer}
+ */
+WebInspector.ResourcesPanel.ResourceRevealer = function()
+{
+}
+
+WebInspector.ResourcesPanel.ResourceRevealer.prototype = {
+    /**
+     * @param {!Object} resource
+     * @param {number=} lineNumber
+     */
+    reveal: function(resource, lineNumber)
+    {
+        if (resource instanceof WebInspector.Resource)
+            /** @type {!WebInspector.ResourcesPanel} */ (WebInspector.showPanel("resources")).showResource(resource, lineNumber);
+    }
 }
 
 /**