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

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

Issue 2232783002: Support action button to fetch more content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippetsbridge
Patch Set: Created 4 years, 4 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 5818ae08fc2e2083a85a2c73ecd1903fa9afdbac..7519e219276bf5938718adcc861d59bf64584bca 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -141,7 +141,7 @@ base::android::ScopedJavaLocalRef<jobject> NTPSnippetsBridge::GetCategoryInfo(
return base::android::ScopedJavaLocalRef<jobject>(env, nullptr);
return Java_SnippetsBridge_createSuggestionsCategoryInfo(
env, ConvertUTF16ToJavaString(env, info->title()).obj(),
- static_cast<int>(info->card_layout()));
+ static_cast<int>(info->card_layout()), info->has_more_button());
}
ScopedJavaLocalRef<jobject> NTPSnippetsBridge::GetSuggestionsForCategory(
@@ -167,6 +167,14 @@ ScopedJavaLocalRef<jobject> NTPSnippetsBridge::GetSuggestionsForCategory(
return result;
}
+void NTPSnippetsBridge::FetchMoreSuggestions(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& obj,
+ jint category) {
+ content_suggestions_service_->FetchMoreSuggestions(
+ content_suggestions_service_->category_factory()->FromIDValue(category));
+}
+
void NTPSnippetsBridge::FetchSuggestionImage(
JNIEnv* env,
const JavaParamRef<jobject>& obj,

Powered by Google App Engine
This is Rietveld 408576698