Chromium Code Reviews| 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 3389af1dd149f3c82f0e81cd561407da7f9bc748..8827695b5d06b4f6b586384716eda8165bade4c6 100644 |
| --- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| +++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| @@ -22,10 +22,8 @@ |
| #include "components/history/core/browser/history_service.h" |
| #include "components/ntp_snippets/content_suggestion.h" |
| #include "components/ntp_snippets/content_suggestions_metrics.h" |
| -#include "components/ntp_snippets/pref_names.h" |
| #include "components/ntp_snippets/remote/remote_suggestions_provider.h" |
| #include "components/ntp_snippets/remote/remote_suggestions_scheduler.h" |
| -#include "components/prefs/pref_service.h" |
| #include "jni/SnippetsBridge_jni.h" |
| #include "ui/base/window_open_disposition.h" |
| #include "ui/gfx/android/java_bitmap.h" |
| @@ -65,7 +63,8 @@ ScopedJavaLocalRef<jobject> ToJavaSuggestionList( |
| ConvertUTF16ToJavaString(env, suggestion.publisher_name()), |
| ConvertUTF16ToJavaString(env, suggestion.snippet_text()), |
| ConvertUTF8ToJavaString(env, suggestion.url().spec()), |
| - suggestion.publish_date().ToJavaTime(), suggestion.score()); |
| + suggestion.publish_date().ToJavaTime(), suggestion.score(), |
| + suggestion.fetch_date().ToJavaTime()); |
| if (suggestion.id().category().IsKnownCategory( |
| KnownCategories::DOWNLOADS) && |
| suggestion.download_suggestion_extra() != nullptr) { |
| @@ -325,16 +324,12 @@ void NTPSnippetsBridge::OnSuggestionShown(JNIEnv* env, |
| jint j_category_id, |
| jint position_in_category, |
| jlong publish_timestamp_ms, |
| - jfloat score) { |
| - PrefService* pref_service = ProfileManager::GetLastUsedProfile()->GetPrefs(); |
| - base::Time last_background_fetch_time = |
| - base::Time::FromInternalValue(pref_service->GetInt64( |
| - ntp_snippets::prefs::kLastSuccessfulBackgroundFetchTime)); |
| - |
| + jfloat score, |
| + jlong fetch_timestamp_ms) { |
| ntp_snippets::metrics::OnSuggestionShown( |
| global_position, Category::FromIDValue(j_category_id), |
| position_in_category, base::Time::FromJavaTime(publish_timestamp_ms), |
| - last_background_fetch_time, score); |
| + base::Time::FromJavaTime(fetch_timestamp_ms), score); |
|
Michael van Ouwerkerk
2017/02/14 12:08:58
Note on argument order: publish_timestamp_ms, fetc
markusheintz_
2017/02/14 13:11:11
Done.
|
| if (global_position == 0) { |
| content_suggestions_service_->user_classifier()->OnEvent( |
| ntp_snippets::UserClassifier::Metric::SUGGESTIONS_SHOWN); |