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

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

Issue 2093913002: DevTools: When no manifest detected, provide user with link to docs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: closure fixes. 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 | third_party/WebKit/Source/devtools/front_end/ui/reportView.css » ('j') | 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..7352c208355e764c0a4772ac0c35aa49c5882026 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
@@ -22,6 +22,14 @@ Resources.AppManifestView = class extends UI.VBox {
addToHomeScreen.addEventListener(UI.ToolbarButton.Events.Click, this._addToHomescreen, this);
toolbar.appendToolbarItem(addToHomeScreen);
+ this._manifestlessSection = this._reportView.appendSection(Common.UIString('No manifest detected'));
+ var p = createElement('p');
+ p.textContent = 'A web manifest allows you to control how your app behaves when launched and displayed to the user. ';
+ p.appendChild(UI.createExternalLink('https://developers.google.com/web/progressive-web-apps/?utm_source=devtools',
+ Common.UIString('Read more on developers.google.com')));
+ this._manifestlessSection.element.appendChild(p);
+ this._manifestlessSection.element.classList.add('hidden');
+
this._presentationSection = this._reportView.appendSection(Common.UIString('Presentation'));
this._iconsSection = this._reportView.appendSection(Common.UIString('Icons'));
@@ -89,8 +97,12 @@ Resources.AppManifestView = class extends UI.VBox {
UI.createLabel(error.message, error.critical ? 'smallicon-error' : 'smallicon-warning'));
}
- if (!data)
- data = '{}';
+ var manifestDataFound = !!data;
+ this._manifestlessSection.element.classList.toggle('hidden', manifestDataFound);
+ this._presentationSection.element.classList.toggle('hidden', !manifestDataFound);
+ this._iconsSection.element.classList.toggle('hidden', !manifestDataFound);
+ this._identitySection.element.classList.toggle('hidden', !manifestDataFound);
+ if (!data) return;
var parsedManifest = JSON.parse(data);
this._nameField.textContent = stringProperty('name');
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/ui/reportView.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698