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

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: 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 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 frame = this._cssModel.resourceTreeModel().frameForId(this.frameId);
pfeldman 2016/07/22 17:33:47 We should use url from the document instead (WebIn
eostroukhov-old 2016/07/25 19:36:11 Done.
81 console.assert(frame); 81 console.assert(frame);
82 var parsedURL = new WebInspector.ParsedURL(frame.url); 82 var parsedURL = new WebInspector.ParsedURL(frame.url);
83 var fakeURL = "inspector://" + parsedURL.host + parsedURL.folderPathComp onents; 83 var fakeURL = "inspector://" + parsedURL.host + parsedURL.folderPathComp onents;
84 if (!fakeURL.endsWith("/")) 84 if (!fakeURL.endsWith("/"))
85 fakeURL += "/"; 85 fakeURL += "/";
86 fakeURL += "inspector-stylesheet"; 86 fakeURL += "inspector-stylesheet";
87 return fakeURL; 87 return fakeURL;
88 }, 88 },
89 89
90 /** 90 /**
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 */ 212 */
213 function performSearch(content) 213 function performSearch(content)
214 { 214 {
215 var searchResults = content ? WebInspector.ContentProvider.performSe archInContent(content, query, caseSensitive, isRegex) : []; 215 var searchResults = content ? WebInspector.ContentProvider.performSe archInContent(content, query, caseSensitive, isRegex) : [];
216 callback(searchResults); 216 callback(searchResults);
217 } 217 }
218 218
219 this.requestContent().then(performSearch); 219 this.requestContent().then(performSearch);
220 } 220 }
221 } 221 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698