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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc

Issue 2435683003: Cleanup desktop NTP metrics recording, part 2 (Closed)
Patch Set: Created 4 years, 2 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: chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
index d249c9df5633eddf0a5135c3b1e74dfa8263d85c..eceaa31352271a8fccae0e9d9f28b6fb4f635340 100644
--- a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.cc
@@ -122,24 +122,22 @@ NTPUserDataLogger* NTPUserDataLogger::GetOrCreateFromWebContents(
void NTPUserDataLogger::LogEvent(NTPLoggingEventType event,
base::TimeDelta time) {
- switch (event) {
- case NTP_SERVER_SIDE_SUGGESTION:
- has_server_side_suggestions_ = true;
- number_of_tiles_++;
- return;
- case NTP_CLIENT_SIDE_SUGGESTION:
- has_client_side_suggestions_ = true;
- number_of_tiles_++;
- return;
- case NTP_ALL_TILES_LOADED:
- EmitNtpStatistics(time);
- return;
- }
- NOTREACHED();
+ DCHECK_EQ(NTP_ALL_TILES_LOADED, event);
+ EmitNtpStatistics(time);
}
void NTPUserDataLogger::LogMostVisitedImpression(
int position, NTPLoggingTileSource tile_source) {
+ switch (tile_source) {
+ case NTPLoggingTileSource::CLIENT:
+ has_client_side_suggestions_ = true;
+ break;
+ case NTPLoggingTileSource::SERVER:
+ has_server_side_suggestions_ = true;
+ break;
+ }
+ number_of_tiles_++;
Marc Treib 2016/10/24 11:51:43 This preserves the previous behavior: set has_clie
sfiera 2016/10/24 13:01:16 Does it matter? number_of_tiles_ is only relevant
Marc Treib 2016/10/24 14:29:11 Exactly, it *shouldn't* matter. If for whatever re
sfiera 2016/10/24 14:41:11 Even better!
+
if ((position >= kNumMostVisited) || impression_was_logged_[position]) {
return;
}

Powered by Google App Engine
This is Rietveld 408576698