Index: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
diff --git a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
index 8c770e9319031bada39b788909c2b588865808f9..624ddb84016795e54a030553684f37dbc44f5b18 100644 |
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js |
@@ -146,6 +146,11 @@ Console.ConsoleView = class extends UI.VBox { |
this._updateFilterStatus(); |
Common.moduleSetting('consoleTimestampFormat').addChangeListener(this._consoleTimestampsSettingChanged, this); |
+ Common.moduleSetting('consoleContextLabelsEnabled') |
+ .addChangeListener(this._consoleContextLabelsSettingChanged, this); |
+ var contextLabelsEnabled = Common.moduleSetting('consoleContextLabelsEnabled').get(); |
+ if (contextLabelsEnabled) |
+ this._messagesElement.classList.add('show-context-icons'); |
this._registerWithMessageSink(); |
SDK.targetManager.observeTargets(this); |
@@ -327,6 +332,16 @@ Console.ConsoleView = class extends UI.VBox { |
this._consoleMessages.forEach(viewMessage => viewMessage.updateTimestamp()); |
} |
+ /** |
+ * @param {!Common.Event} event |
+ */ |
+ _consoleContextLabelsSettingChanged(event) { |
+ this._updateMessageList(); |
+ var contextLabelsEnabled = Common.moduleSetting('consoleContextLabelsEnabled').get(); |
+ this._messagesElement.classList.toggle('show-context-icons', contextLabelsEnabled); |
+ this._consoleMessages.forEach(viewMessage => viewMessage.updateContextLabel()); |
+ } |
+ |
_executionContextChanged() { |
this._prompt.clearAutocomplete(); |
if (!this._showAllMessagesCheckbox.checked()) |
@@ -1217,6 +1232,7 @@ Console.ConsoleCommand = class extends Console.ConsoleViewMessage { |
this._updateSearch(); |
} |
+ this.updateContextLabel(); |
this.updateTimestamp(); |
} |
return this._contentElement; |