Chromium Code Reviews| 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))); |
|
pfeldman
2017/02/07 00:25:35
That's a bad assumption to make.
eostroukhov
2017/02/07 01:40:38
I do not see a cleaner option atm. Note - this is
|
| this._errorsSection.clearContent(); |
| this._errorsSection.element.classList.toggle('hidden', !errors.length); |
| for (var error of errors) { |