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

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

Issue 2666013002: DevTools: render console filter in the main console toolbar. (Closed)
Patch Set: Introduce progress monitor Created 3 years, 10 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 this._contentsElement.classList.add('console-view'); 47 this._contentsElement.classList.add('console-view');
48 /** @type {!Array.<!Console.ConsoleViewMessage>} */ 48 /** @type {!Array.<!Console.ConsoleViewMessage>} */
49 this._visibleViewMessages = []; 49 this._visibleViewMessages = [];
50 this._urlToMessageCount = {}; 50 this._urlToMessageCount = {};
51 this._hiddenByFilterCount = 0; 51 this._hiddenByFilterCount = 0;
52 52
53 /** 53 /**
54 * @type {!Array.<!Console.ConsoleView.RegexMatchRange>} 54 * @type {!Array.<!Console.ConsoleView.RegexMatchRange>}
55 */ 55 */
56 this._regexMatchRanges = []; 56 this._regexMatchRanges = [];
57 this._filter = new Console.ConsoleViewFilter(this._updateMessageList.bind(th is));
57 58
58 this._executionContextComboBox = new UI.ToolbarComboBox(null, 'console-conte xt'); 59 this._executionContextComboBox = new UI.ToolbarComboBox(null, 'console-conte xt');
59 this._executionContextComboBox.setMaxWidth(200); 60 this._executionContextComboBox.setMaxWidth(80);
60 this._consoleContextSelector = new Console.ConsoleContextSelector(this._exec utionContextComboBox.selectElement()); 61 this._consoleContextSelector = new Console.ConsoleContextSelector(this._exec utionContextComboBox.selectElement());
61 62
62 this._showAllMessagesCheckbox = new UI.ToolbarCheckbox(Common.UIString('Show all messages')); 63 this._showSettingsPaneSetting = Common.settings.createSetting('consoleShowSe ttingsToolbar', false);
63 this._filter = new Console.ConsoleViewFilter(this._showAllMessagesCheckbox, this._updateMessageList.bind(this)); 64 this._showSettingsPaneButton = new UI.ToolbarSettingToggle(
65 this._showSettingsPaneSetting, 'largeicon-settings-gear', Common.UIStrin g('Console settings'));
64 66
65 this._filterBar = new UI.FilterBar('consoleView');
66
67 this._preserveLogCheckbox = new UI.ToolbarCheckbox(
68 Common.UIString('Preserve log'), Common.UIString('Do not clear log on pa ge reload / navigation'),
69 Common.moduleSetting('preserveConsoleLog'));
70 this._progressToolbarItem = new UI.ToolbarItem(createElement('div')); 67 this._progressToolbarItem = new UI.ToolbarItem(createElement('div'));
71 68
72 var toolbar = new UI.Toolbar('', this._contentsElement); 69 var toolbar = new UI.Toolbar('', this._contentsElement);
73 toolbar.appendToolbarItem(UI.Toolbar.createActionButton( 70 toolbar.appendToolbarItem(UI.Toolbar.createActionButton(
74 /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); 71 /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear'))));
75 toolbar.appendToolbarItem(this._filterBar.filterButton()); 72 toolbar.appendSeparator();
76 toolbar.appendToolbarItem(this._executionContextComboBox); 73 toolbar.appendToolbarItem(this._executionContextComboBox);
77 toolbar.appendToolbarItem(this._preserveLogCheckbox); 74 toolbar.appendSeparator();
75 toolbar.appendToolbarItem(this._filter._textFilterUI);
76 toolbar.appendToolbarItem(this._filter._levelComboBox);
78 toolbar.appendToolbarItem(this._progressToolbarItem); 77 toolbar.appendToolbarItem(this._progressToolbarItem);
78 toolbar.appendSpacer();
79 toolbar.appendText('');
80 toolbar.appendSeparator();
81 toolbar.appendToolbarItem(this._showSettingsPaneButton);
79 82
80 this._filterBar.show(this._contentsElement); 83 this._preserveLogCheckbox = new UI.ToolbarCheckbox(
81 this._filter.addFilters(this._filterBar); 84 Common.UIString('Preserve log'), Common.UIString('Do not clear log on pa ge reload / navigation'),
85 Common.moduleSetting('preserveConsoleLog'));
86 this._hideNetworkMessagesCheckbox = new UI.ToolbarCheckbox(
87 Common.UIString('Hide network'), Common.UIString('Hide network messages' ),
88 this._filter._hideNetworkMessagesSetting);
89
90 var settingsToolbar = new UI.Toolbar('', this._contentsElement);
91 settingsToolbar.appendToolbarItem(this._hideNetworkMessagesCheckbox);
92 settingsToolbar.appendToolbarItem(this._preserveLogCheckbox);
93 settingsToolbar.appendToolbarItem(this._filter._showTargetMessagesCheckbox);
94 if (!this._showSettingsPaneSetting.get())
95 settingsToolbar.element.classList.add('hidden');
96 this._showSettingsPaneSetting.addChangeListener(
97 () => settingsToolbar.element.classList.toggle('hidden', !this._showSett ingsPaneSetting.get()));
82 98
83 this._viewport = new Console.ConsoleViewport(this); 99 this._viewport = new Console.ConsoleViewport(this);
84 this._viewport.setStickToBottom(true); 100 this._viewport.setStickToBottom(true);
85 this._viewport.contentElement().classList.add('console-group', 'console-grou p-messages'); 101 this._viewport.contentElement().classList.add('console-group', 'console-grou p-messages');
86 this._contentsElement.appendChild(this._viewport.element); 102 this._contentsElement.appendChild(this._viewport.element);
87 this._messagesElement = this._viewport.element; 103 this._messagesElement = this._viewport.element;
88 this._messagesElement.id = 'console-messages'; 104 this._messagesElement.id = 'console-messages';
89 this._messagesElement.classList.add('monospace'); 105 this._messagesElement.classList.add('monospace');
90 this._messagesElement.addEventListener('click', this._messagesClicked.bind(t his), true); 106 this._messagesElement.addEventListener('click', this._messagesClicked.bind(t his), true);
91 107
92 this._viewportThrottler = new Common.Throttler(50); 108 this._viewportThrottler = new Common.Throttler(50);
93 109
94 this._filterStatusMessageElement = createElementWithClass('div', 'console-me ssage'); 110 this._filterStatusMessageElement = createElementWithClass('div', 'console-me ssage');
95 this._messagesElement.insertBefore(this._filterStatusMessageElement, this._m essagesElement.firstChild); 111 this._messagesElement.insertBefore(this._filterStatusMessageElement, this._m essagesElement.firstChild);
96 this._filterStatusTextElement = this._filterStatusMessageElement.createChild ('span', 'console-info'); 112 this._filterStatusTextElement = this._filterStatusMessageElement.createChild ('span', 'console-info');
97 this._filterStatusMessageElement.createTextChild(' '); 113 this._filterStatusMessageElement.createTextChild(' ');
98 this._resetFiltersLink = createElementWithClass('span', 'link');
99 this._resetFiltersLink.textContent = Common.UIString('filters');
100 this._resetFiltersLink.addEventListener('click', () => this._filterBar.showO nce(), true);
101 114
102 this._topGroup = Console.ConsoleGroup.createTopGroup(); 115 this._topGroup = Console.ConsoleGroup.createTopGroup();
103 this._currentGroup = this._topGroup; 116 this._currentGroup = this._topGroup;
104 117
105 this._promptElement = this._messagesElement.createChild('div', 'source-code' ); 118 this._promptElement = this._messagesElement.createChild('div', 'source-code' );
106 var promptIcon = UI.Icon.create('smallicon-text-prompt', 'console-prompt-ico n'); 119 var promptIcon = UI.Icon.create('smallicon-text-prompt', 'console-prompt-ico n');
107 this._promptElement.appendChild(promptIcon); 120 this._promptElement.appendChild(promptIcon);
108 this._promptElement.id = 'console-prompt'; 121 this._promptElement.id = 'console-prompt';
109 this._promptElement.addEventListener('input', this._promptInput.bind(this), false); 122 this._promptElement.addEventListener('input', this._promptInput.bind(this), false);
110 123
111 // FIXME: This is a workaround for the selection machinery bug. See crbug.co m/410899 124 // FIXME: This is a workaround for the selection machinery bug. See crbug.co m/410899
112 var selectAllFixer = this._messagesElement.createChild('div', 'console-view- fix-select-all'); 125 var selectAllFixer = this._messagesElement.createChild('div', 'console-view- fix-select-all');
113 selectAllFixer.textContent = '.'; 126 selectAllFixer.textContent = '.';
114 127
115 this._showAllMessagesCheckbox.inputElement.checked = true;
116 this._showAllMessagesCheckbox.inputElement.addEventListener('change', this._ updateMessageList.bind(this), false);
117
118 this._showAllMessagesCheckbox.element.classList.add('hidden');
119
120 toolbar.appendToolbarItem(this._showAllMessagesCheckbox);
121
122 this._registerShortcuts(); 128 this._registerShortcuts();
123 129
124 this._messagesElement.addEventListener('contextmenu', this._handleContextMen uEvent.bind(this), false); 130 this._messagesElement.addEventListener('contextmenu', this._handleContextMen uEvent.bind(this), false);
125 Common.moduleSetting('monitoringXHREnabled').addChangeListener(this._monitor ingXHREnabledSettingChanged, this); 131 Common.moduleSetting('monitoringXHREnabled').addChangeListener(this._monitor ingXHREnabledSettingChanged, this);
126 132
127 this._linkifier = new Components.Linkifier(); 133 this._linkifier = new Components.Linkifier();
128 134
129 /** @type {!Array.<!Console.ConsoleViewMessage>} */ 135 /** @type {!Array.<!Console.ConsoleViewMessage>} */
130 this._consoleMessages = []; 136 this._consoleMessages = [];
131 this._viewMessageSymbol = Symbol('viewMessage'); 137 this._viewMessageSymbol = Symbol('viewMessage');
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 minimumRowHeight() { 268 minimumRowHeight() {
263 return 16; 269 return 16;
264 } 270 }
265 271
266 /** 272 /**
267 * @override 273 * @override
268 * @param {!SDK.Target} target 274 * @param {!SDK.Target} target
269 */ 275 */
270 targetAdded(target) { 276 targetAdded(target) {
271 this._viewport.invalidate(); 277 this._viewport.invalidate();
272 this._updateAllMessagesCheckbox();
273 } 278 }
274 279
275 /** 280 /**
276 * @override 281 * @override
277 * @param {!SDK.Target} target 282 * @param {!SDK.Target} target
278 */ 283 */
279 targetRemoved(target) { 284 targetRemoved(target) {
280 this._updateAllMessagesCheckbox();
281 }
282
283 _updateAllMessagesCheckbox() {
284 var hasMultipleCotexts = SDK.targetManager.targets(SDK.Target.Capability.JS) .length > 1;
285 this._showAllMessagesCheckbox.element.classList.toggle('hidden', !hasMultipl eCotexts);
286 } 285 }
287 286
288 _registerWithMessageSink() { 287 _registerWithMessageSink() {
289 Common.console.messages().forEach(this._addSinkMessage, this); 288 Common.console.messages().forEach(this._addSinkMessage, this);
290 Common.console.addEventListener(Common.Console.Events.MessageAdded, messageA dded, this); 289 Common.console.addEventListener(Common.Console.Events.MessageAdded, messageA dded, this);
291 290
292 /** 291 /**
293 * @param {!Common.Event} event 292 * @param {!Common.Event} event
294 * @this {Console.ConsoleView} 293 * @this {Console.ConsoleView}
295 */ 294 */
(...skipping 25 matching lines...) Expand all
321 this._addConsoleMessage(consoleMessage); 320 this._addConsoleMessage(consoleMessage);
322 } 321 }
323 322
324 _consoleTimestampsSettingChanged() { 323 _consoleTimestampsSettingChanged() {
325 this._updateMessageList(); 324 this._updateMessageList();
326 this._consoleMessages.forEach(viewMessage => viewMessage.updateTimestamp()); 325 this._consoleMessages.forEach(viewMessage => viewMessage.updateTimestamp());
327 } 326 }
328 327
329 _executionContextChanged() { 328 _executionContextChanged() {
330 this._prompt.clearAutocomplete(); 329 this._prompt.clearAutocomplete();
331 if (!this._showAllMessagesCheckbox.checked()) 330 if (this._filter._showTargetMessagesCheckbox.checked())
332 this._updateMessageList(); 331 this._updateMessageList();
333 } 332 }
334 333
335 /** 334 /**
336 * @override 335 * @override
337 */ 336 */
338 willHide() { 337 willHide() {
339 this._hidePromptSuggestBox(); 338 this._hidePromptSuggestBox();
340 } 339 }
341 340
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 419 }
421 420
422 _immediatelyScrollToBottom() { 421 _immediatelyScrollToBottom() {
423 // This will scroll viewport and trigger its refresh. 422 // This will scroll viewport and trigger its refresh.
424 this._viewport.setStickToBottom(true); 423 this._viewport.setStickToBottom(true);
425 this._promptElement.scrollIntoView(true); 424 this._promptElement.scrollIntoView(true);
426 } 425 }
427 426
428 _updateFilterStatus() { 427 _updateFilterStatus() {
429 this._filterStatusTextElement.removeChildren(); 428 this._filterStatusTextElement.removeChildren();
430 this._filterStatusTextElement.appendChild(UI.formatLocalized( 429 this._filterStatusTextElement.createTextChild(Common.UIString(
431 this._hiddenByFilterCount === 1 ? '1 message is hidden by %s.' : 430 this._hiddenByFilterCount === 1 ? '1 message is hidden by filters.' :
432 this._hiddenByFilterCount + ' messages are hidden by %s.', 431 this._hiddenByFilterCount + ' messages are hidden by filters.'));
433 [this._resetFiltersLink]));
434 this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ? '' : 'none'; 432 this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ? '' : 'none';
435 } 433 }
436 434
437 /** 435 /**
438 * @param {!Common.Event} event 436 * @param {!Common.Event} event
439 */ 437 */
440 _onConsoleMessageAdded(event) { 438 _onConsoleMessageAdded(event) {
441 var message = /** @type {!SDK.ConsoleMessage} */ (event.data); 439 var message = /** @type {!SDK.ConsoleMessage} */ (event.data);
442 this._addConsoleMessage(message); 440 this._addConsoleMessage(message);
443 } 441 }
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after
1029 if (this.itemCount() !== 0 && this._viewport.firstVisibleIndex() !== this.it emCount()) 1027 if (this.itemCount() !== 0 && this._viewport.firstVisibleIndex() !== this.it emCount())
1030 this._immediatelyScrollToBottom(); 1028 this._immediatelyScrollToBottom();
1031 } 1029 }
1032 }; 1030 };
1033 1031
1034 Console.ConsoleView.persistedHistorySize = 300; 1032 Console.ConsoleView.persistedHistorySize = 300;
1035 1033
1036 /** 1034 /**
1037 * @unrestricted 1035 * @unrestricted
1038 */ 1036 */
1039 Console.ConsoleViewFilter = class extends Common.Object { 1037 Console.ConsoleViewFilter = class {
1040 /** 1038 /**
1041 * @param {!UI.ToolbarCheckbox} showAllMessagesCheckbox
1042 * @param {function()} filterChangedCallback 1039 * @param {function()} filterChangedCallback
1043 */ 1040 */
1044 constructor(showAllMessagesCheckbox, filterChangedCallback) { 1041 constructor(filterChangedCallback) {
1045 super(); 1042 this._showTargetMessagesCheckbox =
1046 this._showAllMessagesCheckbox = showAllMessagesCheckbox; 1043 new UI.ToolbarCheckbox(Common.UIString('Selected context only'), undefin ed, undefined, filterChangedCallback);
1047 this._filterChanged = filterChangedCallback; 1044 this._filterChanged = filterChangedCallback;
1048 1045
1049 this._messageURLFiltersSetting = Common.settings.createSetting('messageURLFi lters', {}); 1046 this._messageURLFiltersSetting = Common.settings.createSetting('messageURLFi lters', {});
1050 this._messageLevelFiltersSetting = 1047 this._messageLevelFiltersSetting =
1051 Common.settings.createSetting('messageLevelFilters2', SDK.ConsoleMessage .MessageLevel.Info); 1048 Common.settings.createSetting('messageLevelFilters2', SDK.ConsoleMessage .MessageLevel.Info);
1052 this._hideNetworkMessagesSetting = Common.moduleSetting('hideNetworkMessages '); 1049 this._hideNetworkMessagesSetting = Common.moduleSetting('hideNetworkMessages ');
1053 1050
1054 this._messageURLFiltersSetting.addChangeListener(this._filterChanged); 1051 this._messageURLFiltersSetting.addChangeListener(this._filterChanged);
1055 this._messageLevelFiltersSetting.addChangeListener(this._filterChanged); 1052 this._messageLevelFiltersSetting.addChangeListener(this._filterChanged);
1056 this._hideNetworkMessagesSetting.addChangeListener(this._filterChanged); 1053 this._hideNetworkMessagesSetting.addChangeListener(this._filterChanged);
1057 }
1058 1054
1059 addFilters(filterBar) { 1055 this._textFilterUI = new UI.ToolbarInput(Common.UIString('Filter'), 0.2, 1);
1060 this._textFilterUI = new UI.TextFilterUI(true); 1056 this._textFilterUI.addEventListener(UI.ToolbarInput.Event.TextChanged, this. _textFilterChanged, this);
1061 this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._ textFilterChanged, this);
1062 filterBar.addFilter(this._textFilterUI);
1063
1064 this._hideNetworkMessagesCheckbox =
1065 new UI.CheckboxFilterUI('', Common.UIString('Hide network'), true, this. _hideNetworkMessagesSetting);
1066 1057
1067 var levels = [ 1058 var levels = [
1068 {value: SDK.ConsoleMessage.MessageLevel.Verbose, label: Common.UIString('V erbose')}, 1059 {value: SDK.ConsoleMessage.MessageLevel.Verbose, label: Common.UIString('V erbose')},
1069 {value: SDK.ConsoleMessage.MessageLevel.Info, label: Common.UIString('Info '), default: true}, 1060 {value: SDK.ConsoleMessage.MessageLevel.Info, label: Common.UIString('Info '), default: true},
1070 {value: SDK.ConsoleMessage.MessageLevel.Warning, label: Common.UIString('W arnings')}, 1061 {value: SDK.ConsoleMessage.MessageLevel.Warning, label: Common.UIString('W arnings')},
1071 {value: SDK.ConsoleMessage.MessageLevel.Error, label: Common.UIString('Err ors')} 1062 {value: SDK.ConsoleMessage.MessageLevel.Error, label: Common.UIString('Err ors')}
1072 ]; 1063 ];
1073 1064
1074 var levelFilter = new UI.ComboBoxFilterUI(levels, Common.UIString('Level: ') , this._messageLevelFiltersSetting); 1065 this._levelComboBox =
1075 filterBar.addFilter(levelFilter); 1066 new UI.ToolbarSettingComboBox(levels, this._messageLevelFiltersSetting, Common.UIString('Level'));
1076 filterBar.addFilter(this._hideNetworkMessagesCheckbox);
1077 } 1067 }
1078 1068
1079 _textFilterChanged(event) { 1069 _textFilterChanged() {
1080 this._filterRegex = this._textFilterUI.regex(); 1070 this._filterText = this._textFilterUI.value();
1071 this._filterRegex = null;
1072 if (this._filterText.startsWith('/') && this._filterText.endsWith('/')) {
1073 try {
1074 this._filterRegex = new RegExp(this._filterText.substring(1, this._filte rText.length - 1), 'i');
1075 } catch (e) {
1076 }
1077 }
1081 this._filterChanged(); 1078 this._filterChanged();
1082 } 1079 }
1083 1080
1084 /** 1081 /**
1085 * @param {string} url 1082 * @param {string} url
1086 */ 1083 */
1087 addMessageURLFilter(url) { 1084 addMessageURLFilter(url) {
1088 var value = this._messageURLFiltersSetting.get(); 1085 var value = this._messageURLFiltersSetting.get();
1089 value[url] = true; 1086 value[url] = true;
1090 this._messageURLFiltersSetting.set(value); 1087 this._messageURLFiltersSetting.set(value);
(...skipping 23 matching lines...) Expand all
1114 /** 1111 /**
1115 * @param {!Console.ConsoleViewMessage} viewMessage 1112 * @param {!Console.ConsoleViewMessage} viewMessage
1116 * @return {boolean} 1113 * @return {boolean}
1117 */ 1114 */
1118 shouldBeVisible(viewMessage) { 1115 shouldBeVisible(viewMessage) {
1119 var message = viewMessage.consoleMessage(); 1116 var message = viewMessage.consoleMessage();
1120 var executionContext = UI.context.flavor(SDK.ExecutionContext); 1117 var executionContext = UI.context.flavor(SDK.ExecutionContext);
1121 if (!message.target()) 1118 if (!message.target())
1122 return true; 1119 return true;
1123 1120
1124 if (!this._showAllMessagesCheckbox.checked() && executionContext) { 1121 if (this._showTargetMessagesCheckbox.checked() && executionContext) {
1125 if (message.target() !== executionContext.target()) 1122 if (message.target() !== executionContext.target())
1126 return false; 1123 return false;
1127 if (message.executionContextId && message.executionContextId !== execution Context.id) 1124 if (message.executionContextId && message.executionContextId !== execution Context.id)
1128 return false; 1125 return false;
1129 } 1126 }
1130 1127
1131 if (Common.moduleSetting('hideNetworkMessages').get() && 1128 if (this._hideNetworkMessagesSetting.get() &&
1132 viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource .Network) 1129 viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource .Network)
1133 return false; 1130 return false;
1134 1131
1135 if (viewMessage.consoleMessage().isGroupMessage()) 1132 if (viewMessage.consoleMessage().isGroupMessage())
1136 return true; 1133 return true;
1137 1134
1138 if (message.type === SDK.ConsoleMessage.MessageType.Result || 1135 if (message.type === SDK.ConsoleMessage.MessageType.Result ||
1139 message.type === SDK.ConsoleMessage.MessageType.Command) 1136 message.type === SDK.ConsoleMessage.MessageType.Command)
1140 return true; 1137 return true;
1141 1138
1142 if (message.url && this._messageURLFiltersSetting.get()[message.url]) 1139 if (message.url && this._messageURLFiltersSetting.get()[message.url])
1143 return false; 1140 return false;
1144 1141
1145 var filterOrdinal = SDK.ConsoleMessage.MessageLevel.ordinal( 1142 var filterOrdinal = SDK.ConsoleMessage.MessageLevel.ordinal(
1146 /** @type {!SDK.ConsoleMessage.MessageLevel} */ (this._messageLevelFilte rsSetting.get())); 1143 /** @type {!SDK.ConsoleMessage.MessageLevel} */ (this._messageLevelFilte rsSetting.get()));
1147 if (message.level && SDK.ConsoleMessage.MessageLevel.ordinal(message.level) < filterOrdinal) 1144 if (message.level && SDK.ConsoleMessage.MessageLevel.ordinal(message.level) < filterOrdinal)
1148 return false; 1145 return false;
1149 1146
1150 if (this._filterRegex) { 1147 if (this._filterRegex) {
1151 this._filterRegex.lastIndex = 0;
1152 if (!viewMessage.matchesFilterRegex(this._filterRegex)) 1148 if (!viewMessage.matchesFilterRegex(this._filterRegex))
1153 return false; 1149 return false;
1150 } else if (this._filterText) {
1151 if (!viewMessage.matchesFilterText(this._filterText))
1152 return false;
1154 } 1153 }
1155 1154
1156 return true; 1155 return true;
1157 } 1156 }
1158 1157
1159 reset() { 1158 reset() {
1160 this._messageURLFiltersSetting.set({}); 1159 this._messageURLFiltersSetting.set({});
1161 this._messageLevelFiltersSetting.set(SDK.ConsoleMessage.MessageLevel.Info); 1160 this._messageLevelFiltersSetting.set(SDK.ConsoleMessage.MessageLevel.Info);
1162 this._showAllMessagesCheckbox.inputElement.checked = true; 1161 this._showTargetMessagesCheckbox.inputElement.checked = false;
1163 Common.moduleSetting('hideNetworkMessages').set(false); 1162 this._hideNetworkMessagesSetting.set(false);
1164 this._textFilterUI.setValue(''); 1163 this._textFilterUI.setValue('');
1165 this._filterChanged(); 1164 this._textFilterChanged();
1166 } 1165 }
1167 }; 1166 };
1168 1167
1169 /** 1168 /**
1170 * @unrestricted 1169 * @unrestricted
1171 */ 1170 */
1172 Console.ConsoleCommand = class extends Console.ConsoleViewMessage { 1171 Console.ConsoleCommand = class extends Console.ConsoleViewMessage {
1173 /** 1172 /**
1174 * @param {!SDK.ConsoleMessage} message 1173 * @param {!SDK.ConsoleMessage} message
1175 * @param {!Components.Linkifier} linkifier 1174 * @param {!Components.Linkifier} linkifier
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1318 return true; 1317 return true;
1319 } 1318 }
1320 return false; 1319 return false;
1321 } 1320 }
1322 }; 1321 };
1323 1322
1324 /** 1323 /**
1325 * @typedef {{messageIndex: number, matchIndex: number}} 1324 * @typedef {{messageIndex: number, matchIndex: number}}
1326 */ 1325 */
1327 Console.ConsoleView.RegexMatchRange; 1326 Console.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698