Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 } |
| OLD | NEW |