Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Unified Diff: third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js

Issue 2205853005: [Devtools] Regression fix for double toolbar for images in network (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [Devtools] Regression fix for double toolbar for images in network Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js b/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
index a316ec37b3998595b8294d609638079f1f38e944..45ce5c37f71a8298cd7063c9cb212ea42cbf8cf5 100644
--- a/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
+++ b/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
@@ -38,6 +38,8 @@ WebInspector.RequestPreviewView = function(request, responseView)
{
WebInspector.RequestContentView.call(this, request);
this._responseView = responseView;
+ /** @type {?WebInspector.Widget} */
+ this._previewView = null;
}
WebInspector.RequestPreviewView.prototype = {
@@ -47,21 +49,20 @@ WebInspector.RequestPreviewView.prototype = {
if (!this._emptyWidget) {
this._emptyWidget = this._createEmptyWidget();
this._emptyWidget.show(this.element);
- this.innerView = this._emptyWidget;
- }
- } else {
- if (this._emptyWidget) {
- this._emptyWidget.detach();
- delete this._emptyWidget;
- }
-
- if (!this._previewView) {
- this._createPreviewView(handlePreviewView.bind(this));
- } else {
- this.innerView = this._previewView;
- handlePreviewView.call(this, this.innerView);
+ this._previewView = this._emptyWidget;
lushnikov 2016/08/03 20:09:05 remove
allada 2016/08/03 23:50:05 This is here because it tries to get the content a
}
+ return;
}
+ if (this._emptyWidget) {
+ this._emptyWidget.detach();
+ delete this._emptyWidget;
+ this._previewView = null;
lushnikov 2016/08/03 20:09:05 remove
allada 2016/08/03 23:50:04 needed because of above.
+ }
+
+ if (!this._previewView)
+ this._createPreviewView(handlePreviewView.bind(this));
+ else
+ this._previewView.show(this.element);
/**
* @param {!WebInspector.Widget} view
@@ -70,14 +71,13 @@ WebInspector.RequestPreviewView.prototype = {
function handlePreviewView(view)
{
this._previewView = view;
- this._previewView.show(this.element);
- if (this._previewView instanceof WebInspector.View) {
+ view.show(this.element);
+ if (view instanceof WebInspector.View) {
var toolbar = new WebInspector.Toolbar("network-item-preview-toolbar", this.element);
- for (var item of /** @type {!WebInspector.View} */ (this._previewView).toolbarItems())
+ for (var item of /** @type {!WebInspector.View} */ (view).toolbarItems())
toolbar.appendToolbarItem(item);
}
- this.innerView = this._previewView;
- this._previewViewHandledForTest(this._previewView);
+ this._previewViewHandledForTest(view);
}
},

Powered by Google App Engine
This is Rietveld 408576698