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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 48 this._emptyWidget = this._createEmptyWidget(); | 48 this._emptyWidget = this._createEmptyWidget(); |
| 49 this._emptyWidget.show(this.element); | 49 this._emptyWidget.show(this.element); |
| 50 this.innerView = this._emptyWidget; | 50 this.innerView = this._emptyWidget; |
| 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; |
| 62 handlePreviewView.call(this, this.innerView); | |
| 63 } | |
| 62 } | 64 } |
| 63 | 65 |
| 64 /** | 66 /** |
| 65 * @param {!WebInspector.Widget} view | 67 * @param {!WebInspector.Widget} view |
| 66 * @this {WebInspector.RequestPreviewView} | 68 * @this {WebInspector.RequestPreviewView} |
| 67 */ | 69 */ |
| 68 function handlePreviewView(view) { | 70 function handlePreviewView(view) { |
|
dgozman
2016/08/02 02:51:43
style: while you are here, place { on next line
allada
2016/08/02 16:59:35
Done.
| |
| 69 this._previewView = view; | 71 this._previewView = view; |
| 70 this._previewView.show(this.element); | 72 this._previewView.show(this.element); |
| 71 if (this._previewView instanceof WebInspector.View) { | 73 if (this._previewView instanceof WebInspector.View) { |
| 72 var toolbar = new WebInspector.Toolbar("network-item-preview-too lbar", this.element); | 74 var toolbar = new WebInspector.Toolbar("network-item-preview-too lbar", this.element); |
| 73 for (var item of /** @type {!WebInspector.View} */ (this._previe wView).toolbarItems()) | 75 for (var item of /** @type {!WebInspector.View} */ (this._previe wView).toolbarItems()) |
| 74 toolbar.appendToolbarItem(item); | 76 toolbar.appendToolbarItem(item); |
| 75 } | 77 } |
| 76 this.innerView = this._previewView; | 78 this.innerView = this._previewView; |
| 77 this._previewViewHandledForTest(this._previewView); | 79 this._previewViewHandledForTest(this._previewView); |
| 78 } | 80 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 | 189 |
| 188 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) | 190 if (this.request.resourceType() === WebInspector.resourceTypes.Other ) |
| 189 return this._createEmptyWidget(); | 191 return this._createEmptyWidget(); |
| 190 | 192 |
| 191 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); | 193 return WebInspector.RequestView.nonSourceViewForRequest(this.request ); |
| 192 } | 194 } |
| 193 }, | 195 }, |
| 194 | 196 |
| 195 __proto__: WebInspector.RequestContentView.prototype | 197 __proto__: WebInspector.RequestContentView.prototype |
| 196 } | 198 } |
| OLD | NEW |