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

Unified Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js

Issue 2623143002: DevTools: insert console message decorations in order
Patch Set: a Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698