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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/sdk/CSSStyleSheetHeader.js

Issue 2168323002: [DevTools] Explicitly require ResourceTreeModel (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: [DevTools] Explicitly require ResourceTreeModel Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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 * @implements {WebInspector.ContentProvider} 7 * @implements {WebInspector.ContentProvider}
8 * @param {!WebInspector.CSSModel} cssModel 8 * @param {!WebInspector.CSSModel} cssModel
9 * @param {!CSSAgent.CSSStyleSheetHeader} payload 9 * @param {!CSSAgent.CSSStyleSheetHeader} payload
10 */ 10 */
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 resourceURL: function() 70 resourceURL: function()
71 { 71 {
72 return this.isViaInspector() ? this._viaInspectorResourceURL() : this.so urceURL; 72 return this.isViaInspector() ? this._viaInspectorResourceURL() : this.so urceURL;
73 }, 73 },
74 74
75 /** 75 /**
76 * @return {string} 76 * @return {string}
77 */ 77 */
78 _viaInspectorResourceURL: function() 78 _viaInspectorResourceURL: function()
79 { 79 {
80 var frame = this._cssModel.target().resourceTreeModel.frameForId(this.fr ameId); 80 var resourceTreeModel = WebInspector.ResourceTreeModel.fromTarget(this.t arget());
81 var frame = resourceTreeModel.frameForId(this.frameId);
81 console.assert(frame); 82 console.assert(frame);
82 var parsedURL = new WebInspector.ParsedURL(frame.url); 83 var parsedURL = new WebInspector.ParsedURL(frame.url);
83 var fakeURL = "inspector://" + parsedURL.host + parsedURL.folderPathComp onents; 84 var fakeURL = "inspector://" + parsedURL.host + parsedURL.folderPathComp onents;
84 if (!fakeURL.endsWith("/")) 85 if (!fakeURL.endsWith("/"))
85 fakeURL += "/"; 86 fakeURL += "/";
86 fakeURL += "inspector-stylesheet"; 87 fakeURL += "inspector-stylesheet";
87 return fakeURL; 88 return fakeURL;
88 }, 89 },
89 90
90 /** 91 /**
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 */ 213 */
213 function performSearch(content) 214 function performSearch(content)
214 { 215 {
215 var searchResults = content ? WebInspector.ContentProvider.performSe archInContent(content, query, caseSensitive, isRegex) : []; 216 var searchResults = content ? WebInspector.ContentProvider.performSe archInContent(content, query, caseSensitive, isRegex) : [];
216 callback(searchResults); 217 callback(searchResults);
217 } 218 }
218 219
219 this.requestContent().then(performSearch); 220 this.requestContent().then(performSearch);
220 } 221 }
221 } 222 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698