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

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] Disable "Manifest" if the site has none. 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
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..bf2d4dfbc81a309f49907940e658b4bb5a4bd5fa 100644
--- a/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
+++ b/third_party/WebKit/Source/devtools/front_end/resources/AppManifestView.js
@@ -1,10 +1,6 @@
// Copyright (c) 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-/**
- * @implements {SDK.TargetManager.Observer}
- * @unrestricted
- */
Resources.AppManifestView = class extends UI.VBox {
constructor() {
super(true);
@@ -40,39 +36,6 @@ Resources.AppManifestView = class extends UI.VBox {
this._orientationField = this._presentationSection.appendField(Common.UIString('Orientation'));
this._displayField = this._presentationSection.appendField(Common.UIString('Display'));
-
- SDK.targetManager.observeTargets(this, SDK.Target.Capability.DOM);
- }
-
- /**
- * @override
- * @param {!SDK.Target} target
- */
- targetAdded(target) {
- if (this._resourceTreeModel)
- return;
- var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target);
- if (!resourceTreeModel)
- return;
- this._resourceTreeModel = resourceTreeModel;
- this._updateManifest();
- resourceTreeModel.addEventListener(SDK.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this);
- }
-
- /**
- * @override
- * @param {!SDK.Target} target
- */
- targetRemoved(target) {
- var resourceTreeModel = SDK.ResourceTreeModel.fromTarget(target);
- if (!this._resourceTreeModel || this._resourceTreeModel !== resourceTreeModel)
- return;
- resourceTreeModel.removeEventListener(SDK.ResourceTreeModel.Events.MainFrameNavigated, this._updateManifest, this);
- delete this._resourceTreeModel;
- }
-
- _updateManifest() {
- this._resourceTreeModel.fetchAppManifest(this._renderManifest.bind(this));
}
/**
@@ -80,8 +43,9 @@ Resources.AppManifestView = class extends UI.VBox {
* @param {?string} data
* @param {!Array<!Protocol.Page.AppManifestError>} errors
*/
- _renderManifest(url, data, errors) {
- this._reportView.setURL(Components.Linkifier.linkifyURL(url));
+ renderManifest(url, data, errors) {
+ // This needs to run after the Linkifier listener processes target added event
+ setTimeout(() => this._reportView.setURL(Components.Linkifier.linkifyURL(url)));
this._errorsSection.clearContent();
this._errorsSection.element.classList.toggle('hidden', !errors.length);
for (var error of errors) {

Powered by Google App Engine
This is Rietveld 408576698