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

Unified Diff: chrome/browser/ui/search/search_tab_helper.cc

Issue 1396143002: Emit correct NewTabPage.SuggestionsType metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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/search/search_tab_helper.cc
diff --git a/chrome/browser/ui/search/search_tab_helper.cc b/chrome/browser/ui/search/search_tab_helper.cc
index b90872377821f778acb68b52b954ad61ec98f969..b7bd44f6e2b98ab630cdef7703b845925db960c2 100644
--- a/chrome/browser/ui/search/search_tab_helper.cc
+++ b/chrome/browser/ui/search/search_tab_helper.cc
@@ -397,6 +397,24 @@ void SearchTabHelper::MostVisitedItemsChanged(
// our metrics get inconsistent. So we'd rather emit stats now.
InstantTab::EmitNtpStatistics(web_contents_);
ipc_router_.SendMostVisitedItems(items);
+ LogMostVisitedItemsSource(items);
+}
+
+void SearchTabHelper::LogMostVisitedItemsSource(
+ const std::vector<InstantMostVisitedItem>& items) {
+ for (auto item : items) {
+ NTPLoggingEventType event;
+ if (item.is_server_side_suggestion) {
+ event = NTP_SERVER_SIDE_SUGGESTION;
+ } else {
+ event = NTP_CLIENT_SIDE_SUGGESTION;
+ }
+ // The metrics are emitted for each suggestion as the design requirement
+ // even the ntp_user_data_logger.cc now only supports the scenario:
+ // all suggestions are provided by server OR
+ // all suggestions are provided by client.
+ this->OnLogEvent(event, base::TimeDelta());
+ }
}
void SearchTabHelper::OmniboxStartMarginChanged(int omnibox_start_margin) {
« no previous file with comments | « chrome/browser/ui/search/search_tab_helper.h ('k') | chrome/browser/ui/search/search_tab_helper_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698