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

Side by Side 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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } 51 }
52 } else { 52 } else {
53 if (this._emptyWidget) { 53 if (this._emptyWidget) {
54 this._emptyWidget.detach(); 54 this._emptyWidget.detach();
55 delete this._emptyWidget; 55 delete this._emptyWidget;
56 } 56 }
57 57
58 if (!this._previewView) { 58 if (!this._previewView) {
59 this._createPreviewView(handlePreviewView.bind(this)); 59 this._createPreviewView(handlePreviewView.bind(this));
60 } else { 60 } else {
61 this.innerView = this._previewView; 61 this.innerView = this._previewView;
lushnikov 2016/08/03 17:47:08 this is not needed
62 handlePreviewView.call(this, this.innerView); 62 handlePreviewView.call(this, this.innerView);
63 } 63 }
64 } 64 }
65 65
66 /** 66 /**
67 * @param {!WebInspector.Widget} view 67 * @param {!WebInspector.Widget} view
68 * @this {WebInspector.RequestPreviewView} 68 * @this {WebInspector.RequestPreviewView}
69 */ 69 */
70 function handlePreviewView(view) 70 function handlePreviewView(view)
71 { 71 {
72 this._previewView = view; 72 this._previewView = view;
lushnikov 2016/08/03 17:47:08 it looks to me that this._previewView is equal to
73 var isShowing = this._previewView.isShowing();
lushnikov 2016/08/03 17:38:32 Why does this code run everytime you switch to the
73 this._previewView.show(this.element); 74 this._previewView.show(this.element);
74 if (this._previewView instanceof WebInspector.View) { 75 if (!isShowing && this._previewView instanceof WebInspector.View) {
75 var toolbar = new WebInspector.Toolbar("network-item-preview-too lbar", this.element); 76 var toolbar = new WebInspector.Toolbar("network-item-preview-too lbar", this.element);
76 for (var item of /** @type {!WebInspector.View} */ (this._previe wView).toolbarItems()) 77 for (var item of /** @type {!WebInspector.View} */ (this._previe wView).toolbarItems())
77 toolbar.appendToolbarItem(item); 78 toolbar.appendToolbarItem(item);
78 } 79 }
79 this.innerView = this._previewView; 80 this.innerView = this._previewView;
80 this._previewViewHandledForTest(this._previewView); 81 this._previewViewHandledForTest(this._previewView);
81 } 82 }
82 }, 83 },
83 84
84 /** 85 /**
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 191
191 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) 192 if (this.request.resourceType() === WebInspector.resourceTypes.Other )
192 return this._createEmptyWidget(); 193 return this._createEmptyWidget();
193 194
194 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); 195 return WebInspector.RequestView.nonSourceViewForRequest(this.request );
195 } 196 }
196 }, 197 },
197 198
198 __proto__: WebInspector.RequestContentView.prototype 199 __proto__: WebInspector.RequestContentView.prototype
199 } 200 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698