- // 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));
- }
- }
-