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

Unified Diff: third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js

Issue 2679013004: [DevTools] Show an empty Manifest view if no manifest (Closed)
Patch Set: Redid and introduced an empty view Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« 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