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

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

Issue 2172753002: [DevTools] No longer store security origins in ResourceTreeModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extracted security origins from the ResourceTreeModel Created 4 years, 5 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 WebInspector.targetManager.observeTargets(this); 45 WebInspector.targetManager.observeTargets(this);
46 } 46 }
47 47
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._target) 55 if (this._resourceTreeModel)
56 return; 56 return;
57 this._target = target; 57 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(target );
58 58 if (resourceTreeModel) {
dgozman 2016/07/22 03:27:02 Let's observe DOM capability and assert here inste
eostroukhov-old 2016/07/22 23:27:43 Done.
59 this._updateManifest(); 59 this._resourceTreeModel = resourceTreeModel;
60 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E vents.MainFrameNavigated, this._updateManifest, this); 60 this._updateManifest();
61 resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Ev entTypes.MainFrameNavigated, this._updateManifest, this);
62 }
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 {
69 }, 71 },
70 72
71 _updateManifest: function() 73 _updateManifest: function()
72 { 74 {
73 this._target.resourceTreeModel.fetchAppManifest(this._renderManifest.bin d(this)); 75 if (this._resourceTreeModel)
dgozman 2016/07/22 03:27:02 Judging by previous code, this method is never cal
eostroukhov-old 2016/07/22 23:27:43 Done.
76 this._resourceTreeModel.fetchAppManifest(this._renderManifest.bind(t his));
74 }, 77 },
75 78
76 /** 79 /**
77 * @param {string} url 80 * @param {string} url
78 * @param {?string} data 81 * @param {?string} data
79 * @param {!Array<!PageAgent.AppManifestError>} errors 82 * @param {!Array<!PageAgent.AppManifestError>} errors
80 */ 83 */
81 _renderManifest: function(url, data, errors) 84 _renderManifest: function(url, data, errors)
82 { 85 {
83 this._reportView.setURL(url); 86 this._reportView.setURL(url);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 { 136 {
134 var target = WebInspector.targetManager.mainTarget(); 137 var target = WebInspector.targetManager.mainTarget();
135 if (target && target.hasBrowserCapability()) { 138 if (target && target.hasBrowserCapability()) {
136 target.pageAgent().requestAppBanner(); 139 target.pageAgent().requestAppBanner();
137 WebInspector.console.show(); 140 WebInspector.console.show();
138 } 141 }
139 }, 142 },
140 143
141 __proto__: WebInspector.VBox.prototype 144 __proto__: WebInspector.VBox.prototype
142 } 145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698