| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 /** | 4 /** |
| 5 * @implements {SDK.SDKModelObserver<!SDK.ResourceTreeModel>} | 5 * @implements {SDK.SDKModelObserver<!SDK.ResourceTreeModel>} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 Resources.AppManifestView = class extends UI.VBox { | 8 Resources.AppManifestView = class extends UI.VBox { |
| 9 constructor() { | 9 constructor() { |
| 10 super(true); | 10 super(true); |
| 11 this.registerRequiredCSS('resources/appManifestView.css'); | 11 this.registerRequiredCSS('resources/appManifestView.css'); |
| 12 | 12 |
| 13 this.contentElement.classList.add('overflow-overlay'); |
| 13 this._emptyView = new UI.EmptyWidget(Common.UIString('No manifest detected')
); | 14 this._emptyView = new UI.EmptyWidget(Common.UIString('No manifest detected')
); |
| 14 var p = this._emptyView.appendParagraph(); | 15 var p = this._emptyView.appendParagraph(); |
| 15 var linkElement = UI.createExternalLink('https://developers.google.com/web/f
undamentals/engage-and-retain/web-app-manifest/?utm_source=devtools', | 16 var linkElement = UI.createExternalLink('https://developers.google.com/web/f
undamentals/engage-and-retain/web-app-manifest/?utm_source=devtools', |
| 16 Common.UIString('Read more about the web manifest')); | 17 Common.UIString('Read more about the web manifest')); |
| 17 p.appendChild(UI.formatLocalized('A web manifest allows you to control how y
our app behaves when launched and displayed to the user. %s', [linkElement])); | 18 p.appendChild(UI.formatLocalized('A web manifest allows you to control how y
our app behaves when launched and displayed to the user. %s', [linkElement])); |
| 18 | 19 |
| 19 this._emptyView.show(this.contentElement); | 20 this._emptyView.show(this.contentElement); |
| 20 this._emptyView.hideWidget(); | 21 this._emptyView.hideWidget(); |
| 21 | 22 |
| 22 this._reportView = new UI.ReportView(Common.UIString('App Manifest')); | 23 this._reportView = new UI.ReportView(Common.UIString('App Manifest')); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 * @param {!Common.Event} event | 158 * @param {!Common.Event} event |
| 158 */ | 159 */ |
| 159 _addToHomescreen(event) { | 160 _addToHomescreen(event) { |
| 160 var target = SDK.targetManager.mainTarget(); | 161 var target = SDK.targetManager.mainTarget(); |
| 161 if (target && target.hasBrowserCapability()) { | 162 if (target && target.hasBrowserCapability()) { |
| 162 target.pageAgent().requestAppBanner(); | 163 target.pageAgent().requestAppBanner(); |
| 163 Common.console.show(); | 164 Common.console.show(); |
| 164 } | 165 } |
| 165 } | 166 } |
| 166 }; | 167 }; |
| OLD | NEW |