| OLD | NEW |
| 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 * @implements {Common.ContentProvider} | 5 * @implements {Common.ContentProvider} |
| 6 * @unrestricted | 6 * @unrestricted |
| 7 */ | 7 */ |
| 8 SDK.CSSStyleSheetHeader = class { | 8 SDK.CSSStyleSheetHeader = class { |
| 9 /** | 9 /** |
| 10 * @param {!SDK.CSSModel} cssModel | 10 * @param {!SDK.CSSModel} cssModel |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 */ | 122 */ |
| 123 contentType() { | 123 contentType() { |
| 124 return Common.resourceTypes.Stylesheet; | 124 return Common.resourceTypes.Stylesheet; |
| 125 } | 125 } |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * @override | 128 * @override |
| 129 * @return {!Promise<?string>} | 129 * @return {!Promise<?string>} |
| 130 */ | 130 */ |
| 131 requestContent() { | 131 requestContent() { |
| 132 return /** @type {!Promise<?string>} */ (this._cssModel.getStyleSheetText(th
is.id)); | 132 return this._cssModel.getStyleSheetText(this.id); |
| 133 } | 133 } |
| 134 | 134 |
| 135 /** | 135 /** |
| 136 * @override | 136 * @override |
| 137 * @param {string} query | 137 * @param {string} query |
| 138 * @param {boolean} caseSensitive | 138 * @param {boolean} caseSensitive |
| 139 * @param {boolean} isRegex | 139 * @param {boolean} isRegex |
| 140 * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback | 140 * @param {function(!Array.<!Common.ContentProvider.SearchMatch>)} callback |
| 141 */ | 141 */ |
| 142 searchInContent(query, caseSensitive, isRegex, callback) { | 142 searchInContent(query, caseSensitive, isRegex, callback) { |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 */ | 205 */ |
| 206 function performSearch(content) { | 206 function performSearch(content) { |
| 207 var searchResults = | 207 var searchResults = |
| 208 content ? Common.ContentProvider.performSearchInContent(content, query
, caseSensitive, isRegex) : []; | 208 content ? Common.ContentProvider.performSearchInContent(content, query
, caseSensitive, isRegex) : []; |
| 209 callback(searchResults); | 209 callback(searchResults); |
| 210 } | 210 } |
| 211 | 211 |
| 212 this.requestContent().then(performSearch); | 212 this.requestContent().then(performSearch); |
| 213 } | 213 } |
| 214 }; | 214 }; |
| OLD | NEW |