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

Side by Side Diff: Source/devtools/front_end/sdk/CSSStyleModel.js

Issue 400633003: DevTools: introduce multitarget model listeners (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 12 matching lines...) Expand all
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 /** 31 /**
32 * @constructor 32 * @constructor
33 * @extends {WebInspector.SDKObject} 33 * @extends {WebInspector.SDKModel}
34 * @param {!WebInspector.Target} target 34 * @param {!WebInspector.Target} target
35 */ 35 */
36 WebInspector.CSSStyleModel = function(target) 36 WebInspector.CSSStyleModel = function(target)
37 { 37 {
38 WebInspector.SDKObject.call(this, target); 38 WebInspector.SDKModel.call(this, WebInspector.CSSStyleModel, target);
39 this._domModel = target.domModel; 39 this._domModel = target.domModel;
40 this._agent = target.cssAgent(); 40 this._agent = target.cssAgent();
41 this._pendingCommandsMajorState = []; 41 this._pendingCommandsMajorState = [];
42 this._styleLoader = new WebInspector.CSSStyleModel.ComputedStyleLoader(this) ; 42 this._styleLoader = new WebInspector.CSSStyleModel.ComputedStyleLoader(this) ;
43 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoRequest ed, this._undoRedoRequested, this); 43 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoRequest ed, this._undoRedoRequested, this);
44 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoComplet ed, this._undoRedoCompleted, this); 44 this._domModel.addEventListener(WebInspector.DOMModel.Events.UndoRedoComplet ed, this._undoRedoCompleted, this);
45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.MainFrameNavigated, this._mainFrameNavigated, this); 45 target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.Eve ntTypes.MainFrameNavigated, this._mainFrameNavigated, this);
46 target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this)); 46 target.registerCSSDispatcher(new WebInspector.CSSDispatcher(this));
47 this._agent.enable(this._wasEnabled.bind(this)); 47 this._agent.enable(this._wasEnabled.bind(this));
48 /** @type {!StringMap.<!WebInspector.CSSStyleSheetHeader>} */ 48 /** @type {!StringMap.<!WebInspector.CSSStyleSheetHeader>} */
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 styleSheetIds = styleSheetIds.concat(frameIdToSheetIds[frameId]); 630 styleSheetIds = styleSheetIds.concat(frameIdToSheetIds[frameId]);
631 var uiLocation; 631 var uiLocation;
632 for (var i = 0; !uiLocation && i < styleSheetIds.length; ++i) { 632 for (var i = 0; !uiLocation && i < styleSheetIds.length; ++i) {
633 var header = this.styleSheetHeaderForId(styleSheetIds[i]); 633 var header = this.styleSheetHeaderForId(styleSheetIds[i]);
634 console.assert(header); 634 console.assert(header);
635 uiLocation = header.rawLocationToUILocation(rawLocation.lineNumber, rawLocation.columnNumber); 635 uiLocation = header.rawLocationToUILocation(rawLocation.lineNumber, rawLocation.columnNumber);
636 } 636 }
637 return uiLocation || null; 637 return uiLocation || null;
638 }, 638 },
639 639
640 __proto__: WebInspector.SDKObject.prototype 640 __proto__: WebInspector.SDKModel.prototype
641 } 641 }
642 642
643 /** 643 /**
644 * @constructor 644 * @constructor
645 * @extends {WebInspector.LiveLocation} 645 * @extends {WebInspector.LiveLocation}
646 * @param {!WebInspector.CSSStyleModel} model 646 * @param {!WebInspector.CSSStyleModel} model
647 * @param {?WebInspector.CSSStyleSheetHeader} header 647 * @param {?WebInspector.CSSStyleSheetHeader} header
648 * @param {!WebInspector.CSSLocation} rawLocation 648 * @param {!WebInspector.CSSLocation} rawLocation
649 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat e 649 * @param {function(!WebInspector.UILocation):(boolean|undefined)} updateDelegat e
650 */ 650 */
(...skipping 1189 matching lines...) Expand 10 before | Expand all | Expand 10 after
1840 for (var i = 0; i < callbacks.length; ++i) 1840 for (var i = 0; i < callbacks.length; ++i)
1841 callbacks[i](computedStyle); 1841 callbacks[i](computedStyle);
1842 } 1842 }
1843 } 1843 }
1844 } 1844 }
1845 1845
1846 /** 1846 /**
1847 * @type {!WebInspector.CSSStyleModel} 1847 * @type {!WebInspector.CSSStyleModel}
1848 */ 1848 */
1849 WebInspector.cssModel; 1849 WebInspector.cssModel;
OLDNEW
« no previous file with comments | « Source/devtools/front_end/sdk/CPUProfilerModel.js ('k') | Source/devtools/front_end/sdk/ConsoleModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698