OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * | 10 * |
(...skipping 19 matching lines...) Expand all Loading... |
30 * @constructor | 30 * @constructor |
31 * @extends {WebInspector.SelectionDialogContentProvider} | 31 * @extends {WebInspector.SelectionDialogContentProvider} |
32 * @param {!WebInspector.UISourceCode} uiSourceCode | 32 * @param {!WebInspector.UISourceCode} uiSourceCode |
33 * @param {function(number, number)} selectItemCallback | 33 * @param {function(number, number)} selectItemCallback |
34 */ | 34 */ |
35 WebInspector.StyleSheetOutlineDialog = function(uiSourceCode, selectItemCallback
) | 35 WebInspector.StyleSheetOutlineDialog = function(uiSourceCode, selectItemCallback
) |
36 { | 36 { |
37 WebInspector.SelectionDialogContentProvider.call(this); | 37 WebInspector.SelectionDialogContentProvider.call(this); |
38 this._selectItemCallback = selectItemCallback; | 38 this._selectItemCallback = selectItemCallback; |
39 this._cssParser = new WebInspector.CSSParser(); | 39 this._cssParser = new WebInspector.CSSParser(); |
40 this._cssParser.addEventListener(WebInspector.CSSParser.Events.RulesParsed,
this.refresh.bind(this)); | 40 this._cssParser.parse(uiSourceCode.workingCopy()).then(this.refresh.bind(thi
s)); |
41 this._cssParser.parse(uiSourceCode.workingCopy()); | |
42 } | 41 } |
43 | 42 |
44 /** | 43 /** |
45 * @param {!WebInspector.View} view | 44 * @param {!WebInspector.View} view |
46 * @param {!WebInspector.UISourceCode} uiSourceCode | 45 * @param {!WebInspector.UISourceCode} uiSourceCode |
47 * @param {function(number, number)} selectItemCallback | 46 * @param {function(number, number)} selectItemCallback |
48 */ | 47 */ |
49 WebInspector.StyleSheetOutlineDialog.show = function(view, uiSourceCode, selectI
temCallback) | 48 WebInspector.StyleSheetOutlineDialog.show = function(view, uiSourceCode, selectI
temCallback) |
50 { | 49 { |
51 if (WebInspector.Dialog.currentInstance()) | 50 if (WebInspector.Dialog.currentInstance()) |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 this._selectItemCallback(lineNumber, rule.columnNumber); | 110 this._selectItemCallback(lineNumber, rule.columnNumber); |
112 }, | 111 }, |
113 | 112 |
114 dispose: function() | 113 dispose: function() |
115 { | 114 { |
116 this._cssParser.dispose(); | 115 this._cssParser.dispose(); |
117 }, | 116 }, |
118 | 117 |
119 __proto__: WebInspector.SelectionDialogContentProvider.prototype | 118 __proto__: WebInspector.SelectionDialogContentProvider.prototype |
120 } | 119 } |
OLD | NEW |