Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 915 this._element.className = 'console-message-wrapper'; | 915 this._element.className = 'console-message-wrapper'; |
| 916 this._element.removeChildren(); | 916 this._element.removeChildren(); |
| 917 | 917 |
| 918 this._nestingLevelMarkers = []; | 918 this._nestingLevelMarkers = []; |
| 919 for (var i = 0; i < this._nestingLevel; ++i) | 919 for (var i = 0; i < this._nestingLevel; ++i) |
| 920 this._nestingLevelMarkers.push(this._element.createChild('div', 'nesting-l evel-marker')); | 920 this._nestingLevelMarkers.push(this._element.createChild('div', 'nesting-l evel-marker')); |
| 921 this._updateCloseGroupDecorations(); | 921 this._updateCloseGroupDecorations(); |
| 922 this._element.message = this; | 922 this._element.message = this; |
| 923 | 923 |
| 924 switch (this._message.level) { | 924 switch (this._message.level) { |
| 925 case SDK.ConsoleMessage.MessageLevel.Log: | 925 case SDK.ConsoleMessage.MessageLevel.Verbose: |
| 926 this._element.classList.add('console-log-level'); | 926 this._element.classList.add('console-verbose-level'); |
| 927 this._updateMessageLevelIcon(''); | 927 this._updateMessageLevelIcon(''); |
| 928 break; | 928 break; |
| 929 case SDK.ConsoleMessage.MessageLevel.Debug: | 929 case SDK.ConsoleMessage.MessageLevel.Info: |
| 930 this._element.classList.add('console-debug-level'); | 930 this._element.classList.add('console-info-level'); |
| 931 this._updateMessageLevelIcon(''); | |
| 932 break; | 931 break; |
| 933 case SDK.ConsoleMessage.MessageLevel.Warning: | 932 case SDK.ConsoleMessage.MessageLevel.Warning: |
| 934 this._element.classList.add('console-warning-level'); | 933 this._element.classList.add('console-warning-level'); |
| 935 this._updateMessageLevelIcon('smallicon-warning'); | 934 this._updateMessageLevelIcon('smallicon-warning'); |
| 936 break; | 935 break; |
| 937 case SDK.ConsoleMessage.MessageLevel.Error: | 936 case SDK.ConsoleMessage.MessageLevel.Error: |
| 938 this._element.classList.add('console-error-level'); | 937 this._element.classList.add('console-error-level'); |
| 939 this._updateMessageLevelIcon('smallicon-error'); | 938 this._updateMessageLevelIcon('smallicon-error'); |
| 940 break; | 939 break; |
| 941 case SDK.ConsoleMessage.MessageLevel.Info: | |
| 942 this._element.classList.add('console-info-level'); | |
| 943 this._updateMessageLevelIcon('smallicon-info'); | |
| 944 break; | |
| 945 } | 940 } |
| 946 | 941 |
| 947 this._element.appendChild(this.contentElement()); | 942 this._element.appendChild(this.contentElement()); |
| 948 if (this._repeatCount > 1) | 943 if (this._repeatCount > 1) |
| 949 this._showRepeatCountElement(); | 944 this._showRepeatCountElement(); |
| 950 } | 945 } |
| 951 | 946 |
| 952 /** | 947 /** |
| 953 * @param {string} iconType | 948 * @param {string} iconType |
| 954 */ | 949 */ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 990 | 985 |
| 991 if (!this._repeatCountElement) { | 986 if (!this._repeatCountElement) { |
| 992 this._repeatCountElement = createElementWithClass('label', 'console-messag e-repeat-count', 'dt-small-bubble'); | 987 this._repeatCountElement = createElementWithClass('label', 'console-messag e-repeat-count', 'dt-small-bubble'); |
| 993 switch (this._message.level) { | 988 switch (this._message.level) { |
| 994 case SDK.ConsoleMessage.MessageLevel.Warning: | 989 case SDK.ConsoleMessage.MessageLevel.Warning: |
| 995 this._repeatCountElement.type = 'warning'; | 990 this._repeatCountElement.type = 'warning'; |
| 996 break; | 991 break; |
| 997 case SDK.ConsoleMessage.MessageLevel.Error: | 992 case SDK.ConsoleMessage.MessageLevel.Error: |
| 998 this._repeatCountElement.type = 'error'; | 993 this._repeatCountElement.type = 'error'; |
| 999 break; | 994 break; |
| 1000 case SDK.ConsoleMessage.MessageLevel.Debug: | 995 case SDK.ConsoleMessage.MessageLevel.Verbose: |
| 1001 this._repeatCountElement.type = 'debug'; | 996 this._repeatCountElement.type = 'verbose'; |
|
dgozman
2017/01/20 17:26:33
This requires a change in smallBubble.css.
| |
| 1002 break; | 997 break; |
| 1003 default: | 998 default: |
| 1004 this._repeatCountElement.type = 'info'; | 999 this._repeatCountElement.type = 'info'; |
| 1005 } | 1000 } |
| 1006 this._element.insertBefore(this._repeatCountElement, this._contentElement) ; | 1001 this._element.insertBefore(this._repeatCountElement, this._contentElement) ; |
| 1007 this._contentElement.classList.add('repeated-message'); | 1002 this._contentElement.classList.add('repeated-message'); |
| 1008 } | 1003 } |
| 1009 this._repeatCountElement.textContent = this._repeatCount; | 1004 this._repeatCountElement.textContent = this._repeatCount; |
| 1010 } | 1005 } |
| 1011 | 1006 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1201 toMessageElement() { | 1196 toMessageElement() { |
| 1202 if (!this._element) { | 1197 if (!this._element) { |
| 1203 super.toMessageElement(); | 1198 super.toMessageElement(); |
| 1204 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); | 1199 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); |
| 1205 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); | 1200 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); |
| 1206 this.setCollapsed(this._collapsed); | 1201 this.setCollapsed(this._collapsed); |
| 1207 } | 1202 } |
| 1208 return this._element; | 1203 return this._element; |
| 1209 } | 1204 } |
| 1210 }; | 1205 }; |
| OLD | NEW |