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

Side by Side Diff: Source/devtools/front_end/sources/StyleSheetOutlineDialog.js

Issue 685203003: DevTools: Get rid of synchronous XHRs in the frontend code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698