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

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

Issue 2651843003: DevTools: update console timestamp style (Closed)
Patch Set: ac 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 87c0470fd53622c3f91b73d47378b209e67cb58a..8a1a875f97b666725aa92048d86cee362ae93e68 100644
--- a/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
+++ b/third_party/WebKit/Source/devtools/front_end/console/ConsoleView.js
@@ -145,7 +145,7 @@ Console.ConsoleView = class extends UI.VBox {
this._consoleHistoryAutocompleteChanged();
this._updateFilterStatus();
- Common.moduleSetting('consoleTimestampsEnabled').addChangeListener(this._consoleTimestampsSettingChanged, this);
+ Common.moduleSetting('consoleTimestampFormat').addChangeListener(this._consoleTimestampsSettingChanged, this);
this._registerWithMessageSink();
SDK.targetManager.observeTargets(this);
@@ -323,7 +323,7 @@ Console.ConsoleView = class extends UI.VBox {
* @param {!Common.Event} event
*/
_consoleTimestampsSettingChanged(event) {
- var enabled = /** @type {boolean} */ (event.data);
+ var enabled = /** @type {!Console.ConsoleViewMessage.TimestampFormat} */ (event.data);
this._updateMessageList();
this._consoleMessages.forEach(function(viewMessage) {
viewMessage.updateTimestamp(enabled);
@@ -681,8 +681,9 @@ Console.ConsoleView = class extends UI.VBox {
* @return {boolean}
*/
_tryToCollapseMessages(lastMessage, viewMessage) {
- if (!Common.moduleSetting('consoleTimestampsEnabled').get() && viewMessage &&
- !lastMessage.consoleMessage().isGroupMessage() &&
+ var timestampFormat = Common.moduleSetting('consoleTimestampFormat').get();
+ var timestampsShown = timestampFormat !== Console.ConsoleViewMessage.TimestampFormat.None;
+ if (!timestampsShown && viewMessage && !lastMessage.consoleMessage().isGroupMessage() &&
lastMessage.consoleMessage().isEqual(viewMessage.consoleMessage())) {
viewMessage.incrementRepeatCount();
return true;
@@ -1220,6 +1221,8 @@ Console.ConsoleCommand = class extends Console.ConsoleViewMessage {
} else {
this._updateSearch();
}
+
+ this.updateTimestamp(Common.moduleSetting('consoleTimestampFormat').get());
}
return this._contentElement;
}
@@ -1260,7 +1263,6 @@ Console.ConsoleCommandResult = class extends Console.ConsoleViewMessage {
var icon = UI.Icon.create('smallicon-command-result', 'command-result-icon');
element.insertBefore(icon, element.firstChild);
}
- this.updateTimestamp(false);
return element;
}
};

Powered by Google App Engine
This is Rietveld 408576698