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

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

Issue 2346263002: Extending the UserClassifier to actually support classification. (Closed)
Patch Set: Bernhard's comments 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
« no previous file with comments | « no previous file | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 348e5e95402663c4490ef19e4cd3896e48749ee9..0c830932095664650c0177fa54eeb4f94e509a13 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -268,7 +268,8 @@ void NTPSnippetsBridge::OnPageShown(
suggestions_per_category_int[i]));
}
ntp_snippets::metrics::OnPageShown(suggestions_per_category);
- content_suggestions_service_->user_classifier()->OnNTPOpened();
+ content_suggestions_service_->user_classifier()->OnEvent(
+ ntp_snippets::UserClassifier::Metric::NTP_OPENED);
}
void NTPSnippetsBridge::OnSuggestionShown(JNIEnv* env,
@@ -281,8 +282,10 @@ 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();
+ if (global_position == 0) {
+ content_suggestions_service_->user_classifier()->OnEvent(
+ ntp_snippets::UserClassifier::Metric::SUGGESTIONS_SHOWN);
+ }
}
void NTPSnippetsBridge::OnSuggestionOpened(JNIEnv* env,
@@ -297,7 +300,8 @@ 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();
+ content_suggestions_service_->user_classifier()->OnEvent(
+ ntp_snippets::UserClassifier::Metric::SUGGESTIONS_USED);
}
void NTPSnippetsBridge::OnSuggestionMenuOpened(JNIEnv* env,
@@ -326,7 +330,8 @@ void NTPSnippetsBridge::OnMoreButtonClicked(JNIEnv* env,
jint position) {
ntp_snippets::metrics::OnMoreButtonClicked(CategoryFromIDValue(category),
position);
- content_suggestions_service_->user_classifier()->OnSuggestionsUsed();
+ content_suggestions_service_->user_classifier()->OnEvent(
+ ntp_snippets::UserClassifier::Metric::SUGGESTIONS_USED);
}
NTPSnippetsBridge::~NTPSnippetsBridge() {}
« no previous file with comments | « no previous file | chrome/browser/resources/snippets_internals.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698