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

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

Issue 2419943003: DevTools: allow handing over the raw protocol connection to external clients and back. (Closed)
Patch Set: rebaselined Created 4 years, 2 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 unified diff | Download patch
OLDNEW
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 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @implements {WebInspector.TargetManager.Observer} 8 * @implements {WebInspector.TargetManager.Observer}
9 */ 9 */
10 WebInspector.AppManifestView = function() 10 WebInspector.AppManifestView = function()
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 WebInspector.AppManifestView.prototype = { 48 WebInspector.AppManifestView.prototype = {
49 /** 49 /**
50 * @override 50 * @override
51 * @param {!WebInspector.Target} target 51 * @param {!WebInspector.Target} target
52 */ 52 */
53 targetAdded: function(target) 53 targetAdded: function(target)
54 { 54 {
55 if (this._resourceTreeModel) 55 if (this._resourceTreeModel)
56 return; 56 return;
57 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target ); 57 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target );
58 if (!resourceTreeModel)
59 return;
58 this._resourceTreeModel = resourceTreeModel; 60 this._resourceTreeModel = resourceTreeModel;
59 this._updateManifest(); 61 this._updateManifest();
60 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events .MainFrameNavigated, this._updateManifest, this); 62 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Events .MainFrameNavigated, this._updateManifest, this);
61 }, 63 },
62 64
63 /** 65 /**
64 * @override 66 * @override
65 * @param {!WebInspector.Target} target 67 * @param {!WebInspector.Target} target
66 */ 68 */
67 targetRemoved: function(target) 69 targetRemoved: function(target)
68 { 70 {
71 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target );
72 if (!this._resourceTreeModel || this._resourceTreeModel !== resourceTree Model)
73 return;
74 resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.Eve nts.MainFrameNavigated, this._updateManifest, this);
75 delete this._resourceTreeModel;
69 }, 76 },
70 77
71 _updateManifest: function() 78 _updateManifest: function()
72 { 79 {
73 this._resourceTreeModel.fetchAppManifest(this._renderManifest.bind(this) ); 80 this._resourceTreeModel.fetchAppManifest(this._renderManifest.bind(this) );
74 }, 81 },
75 82
76 /** 83 /**
77 * @param {string} url 84 * @param {string} url
78 * @param {?string} data 85 * @param {?string} data
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 { 142 {
136 var target = WebInspector.targetManager.mainTarget(); 143 var target = WebInspector.targetManager.mainTarget();
137 if (target && target.hasBrowserCapability()) { 144 if (target && target.hasBrowserCapability()) {
138 target.pageAgent().requestAppBanner(); 145 target.pageAgent().requestAppBanner();
139 WebInspector.console.show(); 146 WebInspector.console.show();
140 } 147 }
141 }, 148 },
142 149
143 __proto__: WebInspector.VBox.prototype 150 __proto__: WebInspector.VBox.prototype
144 } 151 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698