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

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

Issue 2781583002: [Content suggestions] Add a function to the service API to fetch favicons (Closed)
Patch Set: Expand the FakeSuggestionsSource Created 3 years, 9 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 8780ce17bf3e28519f63be87d16d7e4db5ad1583..aff844a9fedcdff607bc4ae2c026c36bc5beb716 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -231,6 +231,23 @@ void NTPSnippetsBridge::FetchSuggestionImage(
weak_ptr_factory_.GetWeakPtr(), callback));
}
+void NTPSnippetsBridge::FetchSuggestionFavicon(
+ JNIEnv* env,
+ const JavaParamRef<jobject>& obj,
+ jint j_category_id,
+ const JavaParamRef<jstring>& id_within_category,
+ jint j_minimum_size_in_pixel,
+ jint j_desired_size_in_pixel,
+ const JavaParamRef<jobject>& j_callback) {
+ base::android::ScopedJavaGlobalRef<jobject> callback(j_callback);
Michael van Ouwerkerk 2017/03/28 11:23:56 There's a using statement for ScopedJavaGlobalRef,
jkrcal 2017/03/28 13:12:53 Done (for much more).
+ content_suggestions_service_->FetchSuggestionFavicon(
+ ContentSuggestion::ID(Category::FromIDValue(j_category_id),
+ ConvertJavaStringToUTF8(env, id_within_category)),
+ j_minimum_size_in_pixel, j_desired_size_in_pixel,
+ base::Bind(&NTPSnippetsBridge::OnImageFetched,
+ weak_ptr_factory_.GetWeakPtr(), callback));
+}
+
void NTPSnippetsBridge::Fetch(
JNIEnv* env,
const JavaParamRef<jobject>& obj,

Powered by Google App Engine
This is Rietveld 408576698