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

Side by Side Diff: Source/devtools/front_end/elements/MetricsSidebarPane.js

Issue 1104163003: Devtools: [ElementsPanel] Add dom listeners in sidebars (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@move-force-state
Patch Set: Created 5 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 { 53 {
54 if (this._target === target) 54 if (this._target === target)
55 return; 55 return;
56 56
57 if (this._target) { 57 if (this._target) {
58 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetAdded, this.update, this); 58 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetAdded, this.update, this);
59 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetRemoved, this.update, this); 59 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetRemoved, this.update, this);
60 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetChanged, this.update, this); 60 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .StyleSheetChanged, this.update, this);
61 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .MediaQueryResultChanged, this.update, this); 61 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .MediaQueryResultChanged, this.update, this);
62 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .PseudoStateForced, this.update, this); 62 this._cssModel.removeEventListener(WebInspector.CSSStyleModel.Events .PseudoStateForced, this.update, this);
63 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Node Inserted, this.update, this);
pfeldman 2015/04/28 05:53:20 Can we extract a helper object that would listen t
sergeyv 2015/04/28 08:53:25 Done.
64 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Node Removed, this.update, this);
65 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Dist ributedNodesChanged, this.update, this);
63 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Modified, this._attributesUpdated, this); 66 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Modified, this._attributesUpdated, this);
64 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Removed, this._attributesUpdated, this); 67 this._domModel.removeEventListener(WebInspector.DOMModel.Events.Attr Removed, this._attributesUpdated, this);
65 this._target.resourceTreeModel.removeEventListener(WebInspector.Reso urceTreeModel.EventTypes.FrameResized, this.update, this); 68 this._target.resourceTreeModel.removeEventListener(WebInspector.Reso urceTreeModel.EventTypes.FrameResized, this.update, this);
66 } 69 }
67 this._target = target; 70 this._target = target;
68 if (target) { 71 if (target) {
69 this._domModel = WebInspector.DOMModel.fromTarget(target); 72 this._domModel = WebInspector.DOMModel.fromTarget(target);
70 this._cssModel = WebInspector.CSSStyleModel.fromTarget(target); 73 this._cssModel = WebInspector.CSSStyleModel.fromTarget(target);
71 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetAdded, this.update, this); 74 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetAdded, this.update, this);
72 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetRemoved, this.update, this); 75 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetRemoved, this.update, this);
73 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetChanged, this.update, this); 76 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.St yleSheetChanged, this.update, this);
74 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Me diaQueryResultChanged, this.update, this); 77 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Me diaQueryResultChanged, this.update, this);
75 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Ps eudoStateForced, this.update, this); 78 this._cssModel.addEventListener(WebInspector.CSSStyleModel.Events.Ps eudoStateForced, this.update, this);
79 this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeIns erted, this.update, this);
80 this._domModel.addEventListener(WebInspector.DOMModel.Events.NodeRem oved, this.update, this);
81 this._domModel.addEventListener(WebInspector.DOMModel.Events.Distrib utedNodesChanged, this.update, this);
76 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrMod ified, this._attributesUpdated, this); 82 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrMod ified, this._attributesUpdated, this);
77 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrRem oved, this._attributesUpdated, this); 83 this._domModel.addEventListener(WebInspector.DOMModel.Events.AttrRem oved, this._attributesUpdated, this);
78 this._target.resourceTreeModel.addEventListener(WebInspector.Resourc eTreeModel.EventTypes.FrameResized, this.update, this); 84 this._target.resourceTreeModel.addEventListener(WebInspector.Resourc eTreeModel.EventTypes.FrameResized, this.update, this);
79 } 85 }
80 }, 86 },
81 87
82 /** 88 /**
83 * @override 89 * @override
84 * @param {!WebInspector.Throttler.FinishCallback} finishedCallback 90 * @param {!WebInspector.Throttler.FinishCallback} finishedCallback
85 * @protected 91 * @protected
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 }, 489 },
484 490
485 editingCommitted: function(element, userInput, previousContent, context) 491 editingCommitted: function(element, userInput, previousContent, context)
486 { 492 {
487 this.editingEnded(element, context); 493 this.editingEnded(element, context);
488 this._applyUserInput(element, userInput, previousContent, context, true) ; 494 this._applyUserInput(element, userInput, previousContent, context, true) ;
489 }, 495 },
490 496
491 __proto__: WebInspector.ElementsSidebarPane.prototype 497 __proto__: WebInspector.ElementsSidebarPane.prototype
492 } 498 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/ElementsPanel.js ('k') | Source/devtools/front_end/elements/PlatformFontsSidebarPane.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698