| 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 24 matching lines...) Expand all Loading... |
| 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.addEventListener(WebInspector.CSSParser.Events.RulesParsed,
this.refresh.bind(this)); |
| 41 this._cssParser.parse(uiSourceCode.workingCopy()); | 41 this._cssParser.parse(uiSourceCode.workingCopy()); |
| 42 } | 42 } |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * @param {!WebInspector.Widget} 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(uiSourceCode, selectItemCal
lback) |
| 50 { | 49 { |
| 51 if (WebInspector.Dialog.currentInstance()) | 50 if (WebInspector.Dialog.currentInstance()) |
| 52 return; | 51 return; |
| 53 var delegate = new WebInspector.StyleSheetOutlineDialog(uiSourceCode, select
ItemCallback); | 52 var delegate = new WebInspector.StyleSheetOutlineDialog(uiSourceCode, select
ItemCallback); |
| 54 var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDial
og(delegate); | 53 var filteredItemSelectionDialog = new WebInspector.FilteredItemSelectionDial
og(delegate); |
| 55 WebInspector.Dialog.show(view.element, filteredItemSelectionDialog); | 54 WebInspector.Dialog.show(filteredItemSelectionDialog); |
| 56 } | 55 } |
| 57 | 56 |
| 58 WebInspector.StyleSheetOutlineDialog.prototype = { | 57 WebInspector.StyleSheetOutlineDialog.prototype = { |
| 59 /** | 58 /** |
| 60 * @override | 59 * @override |
| 61 * @return {number} | 60 * @return {number} |
| 62 */ | 61 */ |
| 63 itemCount: function() | 62 itemCount: function() |
| 64 { | 63 { |
| 65 return this._cssParser.rules().length; | 64 return this._cssParser.rules().length; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 this._selectItemCallback(lineNumber, rule.columnNumber); | 115 this._selectItemCallback(lineNumber, rule.columnNumber); |
| 117 }, | 116 }, |
| 118 | 117 |
| 119 dispose: function() | 118 dispose: function() |
| 120 { | 119 { |
| 121 this._cssParser.dispose(); | 120 this._cssParser.dispose(); |
| 122 }, | 121 }, |
| 123 | 122 |
| 124 __proto__: WebInspector.SelectionDialogContentProvider.prototype | 123 __proto__: WebInspector.SelectionDialogContentProvider.prototype |
| 125 } | 124 } |
| OLD | NEW |