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

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

Issue 2654463003: DevTools: render (verbose|info) (intervensions|deprecations|violations) with warning background. (Closed)
Patch Set: tests rebaselined 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 var fragment = 242 var fragment =
243 Components.linkifyStringAsFragmentWithCustomLinkifier(messageText, linkifyRequest.bind(consoleMessage)); 243 Components.linkifyStringAsFragmentWithCustomLinkifier(messageText, linkifyRequest.bind(consoleMessage));
244 messageElement.appendChild(fragment); 244 messageElement.appendChild(fragment);
245 } 245 }
246 } else { 246 } else {
247 messageElement = this._format([messageText]); 247 messageElement = this._format([messageText]);
248 } 248 }
249 } else { 249 } else {
250 if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Violation) 250 if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Violation)
251 messageText = Common.UIString('[Violation] %s', messageText); 251 messageText = Common.UIString('[Violation] %s', messageText);
252 else if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Interv ention)
253 messageText = Common.UIString('[Intervention] %s', messageText);
254 if (consoleMessage.source === SDK.ConsoleMessage.MessageSource.Deprecation )
255 messageText = Common.UIString('[Deprecation] %s', messageText);
252 var args = consoleMessage.parameters || [messageText]; 256 var args = consoleMessage.parameters || [messageText];
253 messageElement = this._format(args); 257 messageElement = this._format(args);
254 } 258 }
255 messageElement.classList.add('console-message-text'); 259 messageElement.classList.add('console-message-text');
256 260
257 var formattedMessage = createElement('span'); 261 var formattedMessage = createElement('span');
258 UI.appendStyle(formattedMessage, 'components/objectValue.css'); 262 UI.appendStyle(formattedMessage, 'components/objectValue.css');
259 formattedMessage.className = 'source-code'; 263 formattedMessage.className = 'source-code';
260 264
261 var anchorElement = this._buildMessageAnchor(consoleMessage); 265 var anchorElement = this._buildMessageAnchor(consoleMessage);
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 case SDK.ConsoleMessage.MessageLevel.Warning: 936 case SDK.ConsoleMessage.MessageLevel.Warning:
933 this._element.classList.add('console-warning-level'); 937 this._element.classList.add('console-warning-level');
934 this._updateMessageLevelIcon('smallicon-warning'); 938 this._updateMessageLevelIcon('smallicon-warning');
935 break; 939 break;
936 case SDK.ConsoleMessage.MessageLevel.Error: 940 case SDK.ConsoleMessage.MessageLevel.Error:
937 this._element.classList.add('console-error-level'); 941 this._element.classList.add('console-error-level');
938 this._updateMessageLevelIcon('smallicon-error'); 942 this._updateMessageLevelIcon('smallicon-error');
939 break; 943 break;
940 } 944 }
941 945
946 // Render verbose and info deprecations, interventions and violations with w arning background.
947 if (this._message.level === SDK.ConsoleMessage.MessageLevel.Verbose ||
948 this._message.level === SDK.ConsoleMessage.MessageLevel.Info) {
949 switch (this._message.source) {
950 case SDK.ConsoleMessage.MessageSource.Violation:
951 case SDK.ConsoleMessage.MessageSource.Deprecation:
952 case SDK.ConsoleMessage.MessageSource.Intervention:
953 this._element.classList.add('console-warning-level');
954 break;
955 }
956 }
957
942 this._element.appendChild(this.contentElement()); 958 this._element.appendChild(this.contentElement());
943 if (this._repeatCount > 1) 959 if (this._repeatCount > 1)
944 this._showRepeatCountElement(); 960 this._showRepeatCountElement();
945 } 961 }
946 962
947 /** 963 /**
948 * @param {string} iconType 964 * @param {string} iconType
949 */ 965 */
950 _updateMessageLevelIcon(iconType) { 966 _updateMessageLevelIcon(iconType) {
951 if (!iconType && !this._messageLevelIcon) 967 if (!iconType && !this._messageLevelIcon)
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
1196 toMessageElement() { 1212 toMessageElement() {
1197 if (!this._element) { 1213 if (!this._element) {
1198 super.toMessageElement(); 1214 super.toMessageElement();
1199 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); 1215 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon');
1200 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); 1216 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild);
1201 this.setCollapsed(this._collapsed); 1217 this.setCollapsed(this._collapsed);
1202 } 1218 }
1203 return this._element; 1219 return this._element;
1204 } 1220 }
1205 }; 1221 };
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/inspector/console-xhr-logging-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698