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

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: 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('');
dgozman 2017/01/31 04:21:29 Why this?
pfeldman 2017/01/31 19:54:44 To render split.
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._showTargetMessagesCheckbo x);
dgozman 2017/01/31 04:21:29 - Commented code? - Is it never here? How does the
pfeldman 2017/01/31 19:54:44 This is removing item from toolbar, so the test pa
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 _consoleTimestampsSettingChanged(event) { 326 _consoleTimestampsSettingChanged(event) {
328 var enabled = /** @type {boolean} */ (event.data); 327 var enabled = /** @type {boolean} */ (event.data);
329 this._updateMessageList(); 328 this._updateMessageList();
330 this._consoleMessages.forEach(function(viewMessage) { 329 this._consoleMessages.forEach(function(viewMessage) {
331 viewMessage.updateTimestamp(enabled); 330 viewMessage.updateTimestamp(enabled);
332 }); 331 });
333 } 332 }
334 333
335 _executionContextChanged() { 334 _executionContextChanged() {
336 this._prompt.clearAutocomplete(); 335 this._prompt.clearAutocomplete();
337 if (!this._showAllMessagesCheckbox.checked()) 336 if (this._filter._showTargetMessagesCheckbox.checked())
338 this._updateMessageList(); 337 this._updateMessageList();
339 } 338 }
340 339
341 /** 340 /**
342 * @override 341 * @override
343 */ 342 */
344 willHide() { 343 willHide() {
345 this._hidePromptSuggestBox(); 344 this._hidePromptSuggestBox();
346 } 345 }
347 346
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 425 }
427 426
428 _immediatelyScrollToBottom() { 427 _immediatelyScrollToBottom() {
429 // This will scroll viewport and trigger its refresh. 428 // This will scroll viewport and trigger its refresh.
430 this._viewport.setStickToBottom(true); 429 this._viewport.setStickToBottom(true);
431 this._promptElement.scrollIntoView(true); 430 this._promptElement.scrollIntoView(true);
432 } 431 }
433 432
434 _updateFilterStatus() { 433 _updateFilterStatus() {
435 this._filterStatusTextElement.removeChildren(); 434 this._filterStatusTextElement.removeChildren();
436 this._filterStatusTextElement.appendChild(UI.formatLocalized( 435 this._filterStatusTextElement.createTextChild(Common.UIString(
437 this._hiddenByFilterCount === 1 ? '1 message is hidden by %s.' : 436 this._hiddenByFilterCount === 1 ? '1 message is hidden by filters.' :
438 this._hiddenByFilterCount + ' messages are hidden by %s.', 437 this._hiddenByFilterCount + ' messages are hidden by filters.'));
dgozman 2017/01/31 04:21:29 Use %d now?
pfeldman 2017/01/31 19:54:44 It is still conditional, right?
439 [this._resetFiltersLink]));
440 this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ? '' : 'none'; 438 this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ? '' : 'none';
441 } 439 }
442 440
443 /** 441 /**
444 * @param {!Common.Event} event 442 * @param {!Common.Event} event
445 */ 443 */
446 _onConsoleMessageAdded(event) { 444 _onConsoleMessageAdded(event) {
447 var message = /** @type {!SDK.ConsoleMessage} */ (event.data); 445 var message = /** @type {!SDK.ConsoleMessage} */ (event.data);
448 this._addConsoleMessage(message); 446 this._addConsoleMessage(message);
449 } 447 }
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 if (this.itemCount() !== 0 && this._viewport.firstVisibleIndex() !== this.it emCount()) 1032 if (this.itemCount() !== 0 && this._viewport.firstVisibleIndex() !== this.it emCount())
1035 this._immediatelyScrollToBottom(); 1033 this._immediatelyScrollToBottom();
1036 } 1034 }
1037 }; 1035 };
1038 1036
1039 Console.ConsoleView.persistedHistorySize = 300; 1037 Console.ConsoleView.persistedHistorySize = 300;
1040 1038
1041 /** 1039 /**
1042 * @unrestricted 1040 * @unrestricted
1043 */ 1041 */
1044 Console.ConsoleViewFilter = class extends Common.Object { 1042 Console.ConsoleViewFilter = class {
1045 /** 1043 /**
1046 * @param {!UI.ToolbarCheckbox} showAllMessagesCheckbox
1047 * @param {function()} filterChangedCallback 1044 * @param {function()} filterChangedCallback
1048 */ 1045 */
1049 constructor(showAllMessagesCheckbox, filterChangedCallback) { 1046 constructor(filterChangedCallback) {
1050 super(); 1047 this._showTargetMessagesCheckbox =
1051 this._showAllMessagesCheckbox = showAllMessagesCheckbox; 1048 new UI.ToolbarCheckbox(Common.UIString('Selected target only'), undefine d, undefined, filterChangedCallback);
dgozman 2017/01/31 04:21:29 Didn't we agree with Paul to use 'frame' or 'conte
pfeldman 2017/01/31 19:54:44 No, I don't think 'frame' is good. You always have
1052 this._filterChanged = filterChangedCallback; 1049 this._filterChanged = filterChangedCallback;
1053 1050
1054 this._messageURLFiltersSetting = Common.settings.createSetting('messageURLFi lters', {}); 1051 this._messageURLFiltersSetting = Common.settings.createSetting('messageURLFi lters', {});
1055 this._messageLevelFiltersSetting = 1052 this._messageLevelFiltersSetting =
1056 Common.settings.createSetting('messageLevelFilters2', SDK.ConsoleMessage .MessageLevel.Info); 1053 Common.settings.createSetting('messageLevelFilters2', SDK.ConsoleMessage .MessageLevel.Info);
1057 this._hideNetworkMessagesSetting = Common.moduleSetting('hideNetworkMessages '); 1054 this._hideNetworkMessagesSetting = Common.moduleSetting('hideNetworkMessages ');
1058 1055
1059 this._messageURLFiltersSetting.addChangeListener(this._filterChanged); 1056 this._messageURLFiltersSetting.addChangeListener(this._filterChanged);
1060 this._messageLevelFiltersSetting.addChangeListener(this._filterChanged); 1057 this._messageLevelFiltersSetting.addChangeListener(this._filterChanged);
1061 this._hideNetworkMessagesSetting.addChangeListener(this._filterChanged); 1058 this._hideNetworkMessagesSetting.addChangeListener(this._filterChanged);
1062 }
1063 1059
1064 addFilters(filterBar) { 1060 this._textFilterUI = new UI.ToolbarInput(Common.UIString('Filter'), 0.2, 1);
1065 this._textFilterUI = new UI.TextFilterUI(true); 1061 this._textFilterUI.addEventListener(UI.ToolbarInput.Event.TextChanged, this. _textFilterChanged, this);
1066 this._textFilterUI.addEventListener(UI.FilterUI.Events.FilterChanged, this._ textFilterChanged, this);
1067 filterBar.addFilter(this._textFilterUI);
1068
1069 this._hideNetworkMessagesCheckbox =
1070 new UI.CheckboxFilterUI('', Common.UIString('Hide network'), true, this. _hideNetworkMessagesSetting);
1071 1062
1072 var levels = [ 1063 var levels = [
1073 {value: SDK.ConsoleMessage.MessageLevel.Verbose, label: Common.UIString('V erbose')}, 1064 {value: SDK.ConsoleMessage.MessageLevel.Verbose, label: Common.UIString('V erbose')},
1074 {value: SDK.ConsoleMessage.MessageLevel.Info, label: Common.UIString('Info '), default: true}, 1065 {value: SDK.ConsoleMessage.MessageLevel.Info, label: Common.UIString('Info '), default: true},
1075 {value: SDK.ConsoleMessage.MessageLevel.Warning, label: Common.UIString('W arnings')}, 1066 {value: SDK.ConsoleMessage.MessageLevel.Warning, label: Common.UIString('W arnings')},
1076 {value: SDK.ConsoleMessage.MessageLevel.Error, label: Common.UIString('Err ors')} 1067 {value: SDK.ConsoleMessage.MessageLevel.Error, label: Common.UIString('Err ors')}
1077 ]; 1068 ];
1078 1069
1079 var levelFilter = new UI.ComboBoxFilterUI(levels, Common.UIString('Level: ') , this._messageLevelFiltersSetting); 1070 this._levelComboBox =
1080 filterBar.addFilter(levelFilter); 1071 new UI.ToolbarSettingComboBox(levels, this._messageLevelFiltersSetting, Common.UIString('Level'));
1081 filterBar.addFilter(this._hideNetworkMessagesCheckbox);
1082 } 1072 }
1083 1073
1084 _textFilterChanged(event) { 1074 _textFilterChanged() {
1085 this._filterRegex = this._textFilterUI.regex(); 1075 this._filterText = this._textFilterUI.value();
1076 this._filterRegex = null;
1077 if (this._filterText.startsWith('/') && this._filterText.endsWith('/')) {
1078 try {
1079 this._filterRegex = new RegExp(this._filterText.substring(1, this._filte rText.length - 1), 'i');
1080 } catch (e) {
1081 }
1082 }
1086 this._filterChanged(); 1083 this._filterChanged();
1087 } 1084 }
1088 1085
1089 /** 1086 /**
1090 * @param {string} url 1087 * @param {string} url
1091 */ 1088 */
1092 addMessageURLFilter(url) { 1089 addMessageURLFilter(url) {
1093 var value = this._messageURLFiltersSetting.get(); 1090 var value = this._messageURLFiltersSetting.get();
1094 value[url] = true; 1091 value[url] = true;
1095 this._messageURLFiltersSetting.set(value); 1092 this._messageURLFiltersSetting.set(value);
(...skipping 23 matching lines...) Expand all
1119 /** 1116 /**
1120 * @param {!Console.ConsoleViewMessage} viewMessage 1117 * @param {!Console.ConsoleViewMessage} viewMessage
1121 * @return {boolean} 1118 * @return {boolean}
1122 */ 1119 */
1123 shouldBeVisible(viewMessage) { 1120 shouldBeVisible(viewMessage) {
1124 var message = viewMessage.consoleMessage(); 1121 var message = viewMessage.consoleMessage();
1125 var executionContext = UI.context.flavor(SDK.ExecutionContext); 1122 var executionContext = UI.context.flavor(SDK.ExecutionContext);
1126 if (!message.target()) 1123 if (!message.target())
1127 return true; 1124 return true;
1128 1125
1129 if (!this._showAllMessagesCheckbox.checked() && executionContext) { 1126 if (this._showTargetMessagesCheckbox.checked() && executionContext) {
1130 if (message.target() !== executionContext.target()) 1127 if (message.target() !== executionContext.target())
1131 return false; 1128 return false;
1132 if (message.executionContextId && message.executionContextId !== execution Context.id) 1129 if (message.executionContextId && message.executionContextId !== execution Context.id)
1133 return false; 1130 return false;
1134 } 1131 }
1135 1132
1136 if (Common.moduleSetting('hideNetworkMessages').get() && 1133 if (this._hideNetworkMessagesSetting.get() &&
1137 viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource .Network) 1134 viewMessage.consoleMessage().source === SDK.ConsoleMessage.MessageSource .Network)
1138 return false; 1135 return false;
1139 1136
1140 if (viewMessage.consoleMessage().isGroupMessage()) 1137 if (viewMessage.consoleMessage().isGroupMessage())
1141 return true; 1138 return true;
1142 1139
1143 if (message.type === SDK.ConsoleMessage.MessageType.Result || 1140 if (message.type === SDK.ConsoleMessage.MessageType.Result ||
1144 message.type === SDK.ConsoleMessage.MessageType.Command) 1141 message.type === SDK.ConsoleMessage.MessageType.Command)
1145 return true; 1142 return true;
1146 1143
1147 if (message.url && this._messageURLFiltersSetting.get()[message.url]) 1144 if (message.url && this._messageURLFiltersSetting.get()[message.url])
1148 return false; 1145 return false;
1149 1146
1150 var filterOrdinal = SDK.ConsoleMessage.MessageLevel.ordinal( 1147 var filterOrdinal = SDK.ConsoleMessage.MessageLevel.ordinal(
1151 /** @type {!SDK.ConsoleMessage.MessageLevel} */ (this._messageLevelFilte rsSetting.get())); 1148 /** @type {!SDK.ConsoleMessage.MessageLevel} */ (this._messageLevelFilte rsSetting.get()));
1152 if (message.level && SDK.ConsoleMessage.MessageLevel.ordinal(message.level) < filterOrdinal) 1149 if (message.level && SDK.ConsoleMessage.MessageLevel.ordinal(message.level) < filterOrdinal)
1153 return false; 1150 return false;
1154 1151
1155 if (this._filterRegex) { 1152 if (this._filterRegex) {
1156 this._filterRegex.lastIndex = 0;
dgozman 2017/01/31 04:21:29 Why removed?
pfeldman 2017/01/31 19:54:44 It is done in matchesFilterRegex call below as wel
1157 if (!viewMessage.matchesFilterRegex(this._filterRegex)) 1153 if (!viewMessage.matchesFilterRegex(this._filterRegex))
1158 return false; 1154 return false;
1155 } else if (this._filterText) {
1156 if (!viewMessage.matchesFilterText(this._filterText))
1157 return false;
1159 } 1158 }
1160 1159
1161 return true; 1160 return true;
1162 } 1161 }
1163 1162
1164 reset() { 1163 reset() {
1165 this._messageURLFiltersSetting.set({}); 1164 this._messageURLFiltersSetting.set({});
1166 this._messageLevelFiltersSetting.set(SDK.ConsoleMessage.MessageLevel.Info); 1165 this._messageLevelFiltersSetting.set(SDK.ConsoleMessage.MessageLevel.Info);
1167 this._showAllMessagesCheckbox.inputElement.checked = true; 1166 this._showTargetMessagesCheckbox.inputElement.checked = false;
1168 Common.moduleSetting('hideNetworkMessages').set(false); 1167 this._hideNetworkMessagesSetting.set(false);
1169 this._textFilterUI.setValue(''); 1168 this._textFilterUI.setValue('');
1170 this._filterChanged(); 1169 this._textFilterChanged();
1171 } 1170 }
1172 }; 1171 };
1173 1172
1174 /** 1173 /**
1175 * @unrestricted 1174 * @unrestricted
1176 */ 1175 */
1177 Console.ConsoleCommand = class extends Console.ConsoleViewMessage { 1176 Console.ConsoleCommand = class extends Console.ConsoleViewMessage {
1178 /** 1177 /**
1179 * @param {!SDK.ConsoleMessage} message 1178 * @param {!SDK.ConsoleMessage} message
1180 * @param {!Components.Linkifier} linkifier 1179 * @param {!Components.Linkifier} linkifier
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1322 return true; 1321 return true;
1323 } 1322 }
1324 return false; 1323 return false;
1325 } 1324 }
1326 }; 1325 };
1327 1326
1328 /** 1327 /**
1329 * @typedef {{messageIndex: number, matchIndex: number}} 1328 * @typedef {{messageIndex: number, matchIndex: number}}
1330 */ 1329 */
1331 Console.ConsoleView.RegexMatchRange; 1330 Console.ConsoleView.RegexMatchRange;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698