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

Unified Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 2315273002: Measure usage metrics to prepare for adaptive fetching rates in M55 (Closed)
Patch Set: Created 4 years, 3 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/android/ntp/ntp_snippets_bridge.cc
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
index f697b5ed961ecc003d0595d5a40d6bb39b20e182..010291582ebc6a242d6cbae4acd2370ac1e55b71 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -244,6 +244,7 @@ void NTPSnippetsBridge::OnPageShown(
suggestions_per_category_int[i]));
}
ntp_snippets::metrics::OnPageShown(suggestions_per_category);
+ content_suggestions_service_->user_classifier()->OnNTPOpened();
}
void NTPSnippetsBridge::OnSuggestionShown(JNIEnv* env,
@@ -256,6 +257,8 @@ void NTPSnippetsBridge::OnSuggestionShown(JNIEnv* env,
ntp_snippets::metrics::OnSuggestionShown(
global_position, CategoryFromIDValue(category), category_position,
TimeFromJavaTime(publish_timestamp_ms), score);
+ if (global_position == 0)
+ content_suggestions_service_->user_classifier()->OnSuggestionsShown();
}
void NTPSnippetsBridge::OnSuggestionOpened(JNIEnv* env,
@@ -270,6 +273,7 @@ void NTPSnippetsBridge::OnSuggestionOpened(JNIEnv* env,
global_position, CategoryFromIDValue(category), category_position,
TimeFromJavaTime(publish_timestamp_ms), score,
static_cast<WindowOpenDisposition>(windowOpenDisposition));
+ content_suggestions_service_->user_classifier()->OnSuggestionsUsed();
}
void NTPSnippetsBridge::OnSuggestionMenuOpened(JNIEnv* env,
@@ -298,6 +302,7 @@ void NTPSnippetsBridge::OnMoreButtonClicked(JNIEnv* env,
jint position) {
ntp_snippets::metrics::OnMoreButtonClicked(CategoryFromIDValue(category),
position);
+ content_suggestions_service_->user_classifier()->OnSuggestionsUsed();
}
NTPSnippetsBridge::~NTPSnippetsBridge() {}

Powered by Google App Engine
This is Rietveld 408576698