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

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

Issue 648263002: DevTools: [Console] checkbox to hide network messages (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix eustas comments Created 6 years, 2 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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after
993 var levels = [ 993 var levels = [
994 {name: "error", label: WebInspector.UIString("Errors")}, 994 {name: "error", label: WebInspector.UIString("Errors")},
995 {name: "warning", label: WebInspector.UIString("Warnings")}, 995 {name: "warning", label: WebInspector.UIString("Warnings")},
996 {name: "info", label: WebInspector.UIString("Info")}, 996 {name: "info", label: WebInspector.UIString("Info")},
997 {name: "log", label: WebInspector.UIString("Logs")}, 997 {name: "log", label: WebInspector.UIString("Logs")},
998 {name: "debug", label: WebInspector.UIString("Debug")} 998 {name: "debug", label: WebInspector.UIString("Debug")}
999 ]; 999 ];
1000 this._levelFilterUI = new WebInspector.NamedBitSetFilterUI(levels, WebIn spector.settings.messageLevelFilters); 1000 this._levelFilterUI = new WebInspector.NamedBitSetFilterUI(levels, WebIn spector.settings.messageLevelFilters);
1001 this._levelFilterUI.addEventListener(WebInspector.FilterUI.Events.Filter Changed, this._filterChanged, this); 1001 this._levelFilterUI.addEventListener(WebInspector.FilterUI.Events.Filter Changed, this._filterChanged, this);
1002 filterBar.addFilter(this._levelFilterUI); 1002 filterBar.addFilter(this._levelFilterUI);
1003 this._hideNetworkMessagesCheckbox = new WebInspector.CheckboxFilterUI("h ide-network-messages", WebInspector.UIString("Hide network messages"), true, Web Inspector.settings.hideNetworkMessages);
1004 this._hideNetworkMessagesCheckbox.addEventListener(WebInspector.FilterUI .Events.FilterChanged, this._filterChanged.bind(this), this);
1005 filterBar.addFilter(this._hideNetworkMessagesCheckbox);
1003 }, 1006 },
1004 1007
1005 _textFilterChanged: function(event) 1008 _textFilterChanged: function(event)
1006 { 1009 {
1007 this._filterRegex = this._textFilterUI.regex(); 1010 this._filterRegex = this._textFilterUI.regex();
1008 1011
1009 this._filterChanged(); 1012 this._filterChanged();
1010 }, 1013 },
1011 1014
1012 /** 1015 /**
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1053 return true; 1056 return true;
1054 1057
1055 if (!this._view._showAllMessagesCheckbox.checked() && executionContext) { 1058 if (!this._view._showAllMessagesCheckbox.checked() && executionContext) {
1056 if (message.target() !== executionContext.target()) 1059 if (message.target() !== executionContext.target())
1057 return false; 1060 return false;
1058 if (message.executionContextId && message.executionContextId !== ex ecutionContext.id) { 1061 if (message.executionContextId && message.executionContextId !== ex ecutionContext.id) {
1059 return false; 1062 return false;
1060 } 1063 }
1061 } 1064 }
1062 1065
1066 if (WebInspector.settings.hideNetworkMessages.get() && viewMessage.conso leMessage().source === WebInspector.ConsoleMessage.MessageSource.Network)
1067 return false;
1068
1063 if (viewMessage.consoleMessage().isGroupMessage()) 1069 if (viewMessage.consoleMessage().isGroupMessage())
1064 return true; 1070 return true;
1065 1071
1066 if (message.type === WebInspector.ConsoleMessage.MessageType.Result || m essage.type === WebInspector.ConsoleMessage.MessageType.Command) 1072 if (message.type === WebInspector.ConsoleMessage.MessageType.Result || m essage.type === WebInspector.ConsoleMessage.MessageType.Command)
1067 return true; 1073 return true;
1068 1074
1069 if (message.url && this._messageURLFilters[message.url]) 1075 if (message.url && this._messageURLFilters[message.url])
1070 return false; 1076 return false;
1071 1077
1072 if (message.level && !this._levelFilterUI.accept(message.level)) 1078 if (message.level && !this._levelFilterUI.accept(message.level))
1073 return false; 1079 return false;
1074 1080
1075 if (this._filterRegex) { 1081 if (this._filterRegex) {
1076 this._filterRegex.lastIndex = 0; 1082 this._filterRegex.lastIndex = 0;
1077 if (!viewMessage.matchesRegex(this._filterRegex)) 1083 if (!viewMessage.matchesRegex(this._filterRegex))
1078 return false; 1084 return false;
1079 } 1085 }
1080 1086
1081 return true; 1087 return true;
1082 }, 1088 },
1083 1089
1084 reset: function() 1090 reset: function()
1085 { 1091 {
1086 this._messageURLFilters = {}; 1092 this._messageURLFilters = {};
1087 WebInspector.settings.messageURLFilters.set(this._messageURLFilters); 1093 WebInspector.settings.messageURLFilters.set(this._messageURLFilters);
1088 WebInspector.settings.messageLevelFilters.set({}); 1094 WebInspector.settings.messageLevelFilters.set({});
1089 this._view._showAllMessagesCheckbox.inputElement.checked = true; 1095 this._view._showAllMessagesCheckbox.inputElement.checked = true;
1096 this._hideNetworkMessagesCheckbox.setState(false);
1090 this._textFilterUI.setValue(""); 1097 this._textFilterUI.setValue("");
1091 this._filterChanged(); 1098 this._filterChanged();
1092 }, 1099 },
1093 1100
1094 __proto__: WebInspector.Object.prototype 1101 __proto__: WebInspector.Object.prototype
1095 }; 1102 };
1096 1103
1097 1104
1098 /** 1105 /**
1099 * @constructor 1106 * @constructor
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1259 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { 1266 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = {
1260 /** 1267 /**
1261 * @return {boolean} 1268 * @return {boolean}
1262 */ 1269 */
1263 handleAction: function() 1270 handleAction: function()
1264 { 1271 {
1265 WebInspector.console.show(); 1272 WebInspector.console.show();
1266 return true; 1273 return true;
1267 } 1274 }
1268 } 1275 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/components/FilterBar.js ('k') | Source/devtools/front_end/console/module.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698