Chromium Code Reviews| Index: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js |
| diff --git a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js |
| index 78f853092f5d751e2f9a983d861050e1675b7923..a3f99ddb9cc27c70d7876009bd5a879e9a078464 100644 |
| --- a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js |
| +++ b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js |
| @@ -10,8 +10,14 @@ Resources.AppManifestView = class extends UI.VBox { |
| super(true); |
| this.registerRequiredCSS('resources/appManifestView.css'); |
| + this._emptyView = new UI.EmptyWidget(Common.UIString('No web app manifest')); |
| + |
| + this._emptyView.show(this.contentElement); |
| + this._emptyView.hideWidget(); |
| + |
| this._reportView = new UI.ReportView(Common.UIString('App Manifest')); |
| this._reportView.show(this.contentElement); |
| + this._reportView.hideWidget(); |
| this._errorsSection = this._reportView.appendSection(Common.UIString('Errors and warnings')); |
| this._identitySection = this._reportView.appendSection(Common.UIString('Identity')); |
| @@ -81,7 +87,15 @@ Resources.AppManifestView = class extends UI.VBox { |
| * @param {!Array<!Protocol.Page.AppManifestError>} errors |
| */ |
| _renderManifest(url, data, errors) { |
| - this._reportView.setURL(Components.Linkifier.linkifyURL(url)); |
| + if (!data && !errors.length) { |
| + this._emptyView.showWidget(); |
| + this._reportView.hideWidget(); |
| + return; |
| + } |
| + this._emptyView.hideWidget(); |
| + this._reportView.showWidget(); |
| + |
| + setTimeout(() => this._reportView.setURL(Components.Linkifier.linkifyURL(url))); |
|
pfeldman
2017/02/07 23:04:38
Drop the setTimeout and this is fine to land.
eostroukhov
2017/02/07 23:20:03
Done :(
|
| this._errorsSection.clearContent(); |
| this._errorsSection.element.classList.toggle('hidden', !errors.length); |
| for (var error of errors) { |