OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" | 5 #include "chrome/browser/ui/webui/ntp/ntp_user_data_logger.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/search/most_visited_iframe_source.h" | 10 #include "chrome/browser/search/most_visited_iframe_source.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 number_of_thumbnail_errors_ = 0; | 120 number_of_thumbnail_errors_ = 0; |
121 UMA_HISTOGRAM_NTP_TILES("NewTabPage.NumberOfGrayTileFallbacks", | 121 UMA_HISTOGRAM_NTP_TILES("NewTabPage.NumberOfGrayTileFallbacks", |
122 number_of_gray_tile_fallbacks_); | 122 number_of_gray_tile_fallbacks_); |
123 number_of_gray_tile_fallbacks_ = 0; | 123 number_of_gray_tile_fallbacks_ = 0; |
124 UMA_HISTOGRAM_NTP_TILES("NewTabPage.NumberOfExternalTileFallbacks", | 124 UMA_HISTOGRAM_NTP_TILES("NewTabPage.NumberOfExternalTileFallbacks", |
125 number_of_external_tile_fallbacks_); | 125 number_of_external_tile_fallbacks_); |
126 number_of_external_tile_fallbacks_ = 0; | 126 number_of_external_tile_fallbacks_ = 0; |
127 } | 127 } |
128 } | 128 } |
129 | 129 |
130 void NTPUserDataLogger::LogEvent(NTPLoggingEventType event) { | 130 void NTPUserDataLogger::LogEvent(NTPLoggingEventType event, |
| 131 base::TimeDelta time) { |
131 switch (event) { | 132 switch (event) { |
132 case NTP_SERVER_SIDE_SUGGESTION: | 133 case NTP_SERVER_SIDE_SUGGESTION: |
133 has_server_side_suggestions_ = true; | 134 has_server_side_suggestions_ = true; |
134 break; | 135 break; |
135 case NTP_CLIENT_SIDE_SUGGESTION: | 136 case NTP_CLIENT_SIDE_SUGGESTION: |
136 // We should never get a mix of server and client side suggestions, | 137 // We should never get a mix of server and client side suggestions, |
137 // otherwise there could be a race condition depending on the order in | 138 // otherwise there could be a race condition depending on the order in |
138 // which the iframes call this method. | 139 // which the iframes call this method. |
139 DCHECK(!has_server_side_suggestions_); | 140 DCHECK(!has_server_side_suggestions_); |
140 break; | 141 break; |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 has_server_side_suggestions_(false), | 232 has_server_side_suggestions_(false), |
232 number_of_tiles_(0), | 233 number_of_tiles_(0), |
233 number_of_thumbnail_tiles_(0), | 234 number_of_thumbnail_tiles_(0), |
234 number_of_gray_tiles_(0), | 235 number_of_gray_tiles_(0), |
235 number_of_external_tiles_(0), | 236 number_of_external_tiles_(0), |
236 number_of_thumbnail_errors_(0), | 237 number_of_thumbnail_errors_(0), |
237 number_of_gray_tile_fallbacks_(0), | 238 number_of_gray_tile_fallbacks_(0), |
238 number_of_external_tile_fallbacks_(0), | 239 number_of_external_tile_fallbacks_(0), |
239 number_of_mouseovers_(0) { | 240 number_of_mouseovers_(0) { |
240 } | 241 } |
OLD | NEW |