Title: [183329] trunk/Source/WebInspectorUI
Revision
183329
Author
[email protected]
Date
2015-04-25 18:19:35 -0700 (Sat, 25 Apr 2015)

Log Message

Web Inspector: Remove Reload and Download Web Archive buttons from FrameTreeElement
https://bugs.webkit.org/show_bug.cgi?id=144064

The will be global toolbar items soon.

Reviewed by Joseph Pecoraro.

* UserInterface/Views/FrameTreeElement.js:
* UserInterface/Views/ResourceTreeElement.js:
(WebInspector.ResourceTreeElement.prototype._updateStatus):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (183328 => 183329)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-04-26 01:19:08 UTC (rev 183328)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-04-26 01:19:35 UTC (rev 183329)
@@ -1,5 +1,18 @@
 2015-04-22  Timothy Hatcher  <[email protected]>
 
+        Web Inspector: Remove Reload and Download Web Archive buttons from FrameTreeElement
+        https://bugs.webkit.org/show_bug.cgi?id=144064
+
+        The will be global toolbar items soon.
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/FrameTreeElement.js:
+        * UserInterface/Views/ResourceTreeElement.js:
+        (WebInspector.ResourceTreeElement.prototype._updateStatus):
+
+2015-04-22  Timothy Hatcher  <[email protected]>
+
         Web Inspector: Remove time and weight from the dashboard
         https://bugs.webkit.org/show_bug.cgi?id=144063
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js (183328 => 183329)


--- trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js	2015-04-26 01:19:08 UTC (rev 183328)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/FrameTreeElement.js	2015-04-26 01:19:35 UTC (rev 183329)
@@ -135,23 +135,8 @@
     {
         // Immediate superclasses are skipped, since Frames handle their own SourceMapResources.
         WebInspector.GeneralTreeElement.prototype.onattach.call(this);
-
-        if (this._frame.isMainFrame()) {
-            WebInspector.notifications.addEventListener(WebInspector.Notification.PageArchiveStarted, this._pageArchiveStarted, this);
-            WebInspector.notifications.addEventListener(WebInspector.Notification.PageArchiveEnded, this._pageArchiveEnded, this);
-        }
     }
 
-    ondetach()
-    {
-        WebInspector.ResourceTreeElement.prototype.ondetach.call(this);
-
-        if (this._frame.isMainFrame()) {
-            WebInspector.notifications.removeEventListener(WebInspector.Notification.PageArchiveStarted, this._pageArchiveStarted, this);
-            WebInspector.notifications.removeEventListener(WebInspector.Notification.PageArchiveEnded, this._pageArchiveEnded, this);
-        }
-    }
-
     // Overrides from FolderizedTreeElement (Protected).
 
     compareChildTreeElements(a, b)
@@ -175,52 +160,6 @@
         return aIsResource ? 1 : -1;
     }
 
-    // Called from ResourceTreeElement.
-
-    updateStatusForMainFrame()
-    {
-        function loadedImages()
-        {
-            if (!this._reloadButton || !this._downloadButton)
-                return;
-
-            var fragment = document.createDocumentFragment("div");
-            fragment.appendChild(this._downloadButton.element);
-            fragment.appendChild(this._reloadButton.element);
-            this.status = fragment;
-
-            delete this._loadingMainFrameButtons;
-        }
-
-        if (this._reloadButton && this._downloadButton) {
-            loadedImages.call(this);
-            return;
-        }
-
-        if (!this._loadingMainFrameButtons) {
-            this._loadingMainFrameButtons = true;
-
-            var tooltip;
-            if (WebInspector.debuggableType === WebInspector.DebuggableType._javascript_)
-                tooltip = WebInspector.UIString("Restart (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName);
-            else
-                tooltip = WebInspector.UIString("Reload page (%s)\nReload ignoring cache (%s)").format(WebInspector._reloadPageKeyboardShortcut.displayName, WebInspector._reloadPageIgnoringCacheKeyboardShortcut.displayName);
-
-            wrappedSVGDocument(platformImagePath("Reload.svg"), null, tooltip, function(element) {
-                this._reloadButton = new WebInspector.TreeElementStatusButton(element);
-                this._reloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._reloadPageClicked, this);
-                loadedImages.call(this);
-            }.bind(this));
-
-            wrappedSVGDocument(platformImagePath("DownloadArrow.svg"), null, WebInspector.UIString("Download Web Archive"), function(element) {
-                this._downloadButton = new WebInspector.TreeElementStatusButton(element);
-                this._downloadButton.addEventListener(WebInspector.TreeElementStatusButton.Event.Clicked, this._downloadButtonClicked, this);
-                this._updateDownloadButton();
-                loadedImages.call(this);
-            }.bind(this));
-        }
-    }
-
     // Overrides from TreeElement (Private).
 
     onpopulate()
@@ -288,9 +227,6 @@
         // shouldRefreshChildren will call onpopulate if expanded is true.
         this._updateExpandedSetting();
 
-        if (this._frame.isMainFrame())
-            this._updateDownloadButton();
-
         this.shouldRefreshChildren = true;
     }
 
@@ -329,46 +265,4 @@
         if (this.expanded)
             this._frame.domTree.requestContentFlowList();
     }
-
-    _reloadPageClicked(event)
-    {
-        // Ignore cache when the shift key is pressed.
-        PageAgent.reload(event.data.shiftKey);
-    }
-
-    _downloadButtonClicked(event)
-    {
-        WebInspector.archiveMainFrame();
-    }
-
-    _updateDownloadButton()
-    {
-        console.assert(this._frame.isMainFrame());
-        if (!this._downloadButton)
-            return;
-
-        if (!PageAgent.archive || WebInspector.debuggableType !== WebInspector.DebuggableType.Web) {
-            this._downloadButton.hidden = true;
-            return;
-        }
-
-        if (this._downloadingPage) {
-            this._downloadButton.enabled = false;
-            return;
-        }
-
-        this._downloadButton.enabled = WebInspector.canArchiveMainFrame();
-    }
-
-    _pageArchiveStarted(event)
-    {
-        this._downloadingPage = true;
-        this._updateDownloadButton();
-    }
-
-    _pageArchiveEnded(event)
-    {
-        this._downloadingPage = false;
-        this._updateDownloadButton();
-    }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js (183328 => 183329)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js	2015-04-26 01:19:08 UTC (rev 183328)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ResourceTreeElement.js	2015-04-26 01:19:35 UTC (rev 183329)
@@ -160,12 +160,8 @@
             this.removeClassName(WebInspector.ResourceTreeElement.FailedStyleClassName);
 
         if (this._resource.finished || this._resource.failed) {
-            // Remove the spinner and replace with a reload button in case it's the main frame's main resource.
-            var frame = this._resource.parentFrame;
-            if (this._resource.isMainResource() && frame && frame.isMainFrame() && this instanceof WebInspector.FrameTreeElement)
-                this.updateStatusForMainFrame();
-            else
-                this.status = "";
+            // Remove the spinner.
+            this.status = "";
         } else {
             var spinner = new WebInspector.IndeterminateProgressSpinner;
             this.status = spinner.element;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to