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

Side by Side Diff: Source/devtools/front_end/console/ConsoleView.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) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 this._prompt.setHistoryData(historyData); 137 this._prompt.setHistoryData(historyData);
138 138
139 this._updateFilterStatus(); 139 this._updateFilterStatus();
140 WebInspector.settings.consoleTimestampsEnabled.addChangeListener(this._conso leTimestampsSettingChanged, this); 140 WebInspector.settings.consoleTimestampsEnabled.addChangeListener(this._conso leTimestampsSettingChanged, this);
141 141
142 this._registerWithMessageSink(); 142 this._registerWithMessageSink();
143 WebInspector.targetManager.observeTargets(this); 143 WebInspector.targetManager.observeTargets(this);
144 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleMo del.Events.ConsoleCleared, this._consoleCleared, this); 144 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleMo del.Events.ConsoleCleared, this._consoleCleared, this);
145 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleMo del.Events.MessageAdded, this._onConsoleMessageAdded, this); 145 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleMo del.Events.MessageAdded, this._onConsoleMessageAdded, this);
146 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleMo del.Events.CommandEvaluated, this._commandEvaluated, this); 146 WebInspector.multitargetConsoleModel.addEventListener(WebInspector.ConsoleMo del.Events.CommandEvaluated, this._commandEvaluated, this);
147 WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebIn spector.RuntimeModel.Events.ExecutionContextCreated, this._onExecutionContextCre ated, this);
148 WebInspector.targetManager.addModelListener(WebInspector.RuntimeModel, WebIn spector.RuntimeModel.Events.ExecutionContextDestroyed, this._onExecutionContextD estroyed, this);
149
147 /** 150 /**
148 * @param {!WebInspector.ConsoleMessage} message 151 * @param {!WebInspector.ConsoleMessage} message
149 * @this {WebInspector.ConsoleView} 152 * @this {WebInspector.ConsoleView}
150 */ 153 */
151 function appendMessage(message) 154 function appendMessage(message)
152 { 155 {
153 var viewMessage = this._createViewMessage(message); 156 var viewMessage = this._createViewMessage(message);
154 this._consoleMessageAdded(viewMessage); 157 this._consoleMessageAdded(viewMessage);
155 } 158 }
156 159
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 return 16; 197 return 16;
195 }, 198 },
196 199
197 /** 200 /**
198 * @param {!WebInspector.Target} target 201 * @param {!WebInspector.Target} target
199 */ 202 */
200 targetAdded: function(target) 203 targetAdded: function(target)
201 { 204 {
202 this._viewport.invalidate(); 205 this._viewport.invalidate();
203 target.runtimeModel.executionContexts().forEach(this._executionContextCr eated, this); 206 target.runtimeModel.executionContexts().forEach(this._executionContextCr eated, this);
204 target.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.Ex ecutionContextCreated, this._onExecutionContextCreated, this);
205 target.runtimeModel.addEventListener(WebInspector.RuntimeModel.Events.Ex ecutionContextDestroyed, this._onExecutionContextDestroyed, this);
206 }, 207 },
207 208
208 /** 209 /**
209 * @param {!WebInspector.Target} target 210 * @param {!WebInspector.Target} target
210 */ 211 */
211 targetRemoved: function(target) 212 targetRemoved: function(target)
212 { 213 {
213 this._clearExecutionContextsForTarget(target); 214 this._clearExecutionContextsForTarget(target);
214 target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events .ExecutionContextCreated, this._onExecutionContextCreated, this);
215 target.runtimeModel.removeEventListener(WebInspector.RuntimeModel.Events .ExecutionContextDestroyed, this._onExecutionContextDestroyed, this);
216 }, 215 },
217 216
218 _registerWithMessageSink: function() 217 _registerWithMessageSink: function()
219 { 218 {
220 WebInspector.console.messages().forEach(this._addSinkMessage, this); 219 WebInspector.console.messages().forEach(this._addSinkMessage, this);
221 WebInspector.console.addEventListener(WebInspector.Console.Events.Messag eAdded, messageAdded, this); 220 WebInspector.console.addEventListener(WebInspector.Console.Events.Messag eAdded, messageAdded, this);
222 221
223 /** 222 /**
224 * @param {!WebInspector.Event} event 223 * @param {!WebInspector.Event} event
225 * @this {WebInspector.ConsoleView} 224 * @this {WebInspector.ConsoleView}
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { 1215 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = {
1217 /** 1216 /**
1218 * @return {boolean} 1217 * @return {boolean}
1219 */ 1218 */
1220 handleAction: function() 1219 handleAction: function()
1221 { 1220 {
1222 WebInspector.console.show(); 1221 WebInspector.console.show();
1223 return true; 1222 return true;
1224 } 1223 }
1225 } 1224 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/components/ExecutionContextSelector.js ('k') | Source/devtools/front_end/elements/ElementsPanel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698