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

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: [DevTools] Show an empty pane for no manifest 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..a8ae577c0bb8cb97bf410bea7372373840173ee6 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,6 +87,14 @@ Resources.AppManifestView = class extends UI.VBox {
* @param {!Array<!Protocol.Page.AppManifestError>} errors
*/
_renderManifest(url, data, errors) {
+ if (!data && !errors.length) {
+ this._emptyView.showWidget();
+ this._reportView.hideWidget();
+ return;
+ }
+ this._emptyView.hideWidget();
+ this._reportView.showWidget();
+
this._reportView.setURL(Components.Linkifier.linkifyURL(url));
this._errorsSection.clearContent();
this._errorsSection.element.classList.toggle('hidden', !errors.length);
« 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