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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2146163002: [DevTools] Remove Console.messagesCleared event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2139543002
Patch Set: rebased on ToT Created 4 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
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 143
144 this._consoleHistoryAutocompleteSetting = WebInspector.moduleSetting("consol eHistoryAutocomplete"); 144 this._consoleHistoryAutocompleteSetting = WebInspector.moduleSetting("consol eHistoryAutocomplete");
145 this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHisto ryAutocompleteChanged, this); 145 this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHisto ryAutocompleteChanged, this);
146 this._consoleHistoryAutocompleteChanged(); 146 this._consoleHistoryAutocompleteChanged();
147 147
148 this._updateFilterStatus(); 148 this._updateFilterStatus();
149 WebInspector.moduleSetting("consoleTimestampsEnabled").addChangeListener(thi s._consoleTimestampsSettingChanged, this); 149 WebInspector.moduleSetting("consoleTimestampsEnabled").addChangeListener(thi s._consoleTimestampsSettingChanged, this);
150 150
151 this._registerWithMessageSink(); 151 this._registerWithMessageSink();
152 WebInspector.targetManager.observeTargets(this); 152 WebInspector.targetManager.observeTargets(this);
153 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event s.MainFrameNavigated, this._onMainFrameNavigated, this);
154 153
155 this._initConsoleMessages(); 154 this._initConsoleMessages();
156 155
157 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this); 156 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext, this._executionContextChanged, this);
158 } 157 }
159 158
160 WebInspector.ConsoleView.persistedHistorySize = 300; 159 WebInspector.ConsoleView.persistedHistorySize = 300;
161 160
162 WebInspector.ConsoleView.prototype = { 161 WebInspector.ConsoleView.prototype = {
163 /** 162 /**
164 * @return {!WebInspector.SearchableView} 163 * @return {!WebInspector.SearchableView}
165 */ 164 */
166 searchableView: function() 165 searchableView: function()
167 { 166 {
168 return this._searchableView; 167 return this._searchableView;
169 }, 168 },
170 169
171 _clearHistory: function() 170 _clearHistory: function()
172 { 171 {
173 this._consoleHistorySetting.set([]); 172 this._consoleHistorySetting.set([]);
174 this._prompt.setHistoryData([]); 173 this._prompt.setHistoryData([]);
175 }, 174 },
176 175
177 _consoleHistoryAutocompleteChanged: function() 176 _consoleHistoryAutocompleteChanged: function()
178 { 177 {
179 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocomple teSetting.get()); 178 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocomple teSetting.get());
180 }, 179 },
181 180
182 /**
183 * @param {!WebInspector.Event} event
184 */
185 _onMainFrameNavigated: function(event)
186 {
187 if (!WebInspector.moduleSetting("preserveConsoleLog").get())
188 return;
189 var frame = /** @type {!WebInspector.ResourceTreeFrame} */(event.data);
190 WebInspector.console.log(WebInspector.UIString("Navigated to %s", frame. url));
191 },
192
193 _initConsoleMessages: function() 181 _initConsoleMessages: function()
194 { 182 {
195 var mainTarget = WebInspector.targetManager.mainTarget(); 183 var mainTarget = WebInspector.targetManager.mainTarget();
196 if (!mainTarget || !mainTarget.resourceTreeModel.cachedResourcesLoaded() ) { 184 if (!mainTarget || !mainTarget.resourceTreeModel.cachedResourcesLoaded() ) {
197 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._o nResourceTreeModelLoaded, this); 185 WebInspector.targetManager.addModelListener(WebInspector.ResourceTre eModel, WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._o nResourceTreeModelLoaded, this);
198 return; 186 return;
199 } 187 }
200 this._fetchMultitargetMessages(); 188 this._fetchMultitargetMessages();
201 }, 189 },
202 190
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 return true; 1330 return true;
1343 } 1331 }
1344 return false; 1332 return false;
1345 } 1333 }
1346 } 1334 }
1347 1335
1348 /** 1336 /**
1349 * @typedef {{messageIndex: number, matchIndex: number}} 1337 * @typedef {{messageIndex: number, matchIndex: number}}
1350 */ 1338 */
1351 WebInspector.ConsoleView.RegexMatchRange; 1339 WebInspector.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698