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 5818ae08fc2e2083a85a2c73ecd1903fa9afdbac..5adca0ff77e0331c0764a19fb4548bf2e6c6b801 100644 |
| --- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| +++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| @@ -148,6 +148,14 @@ ScopedJavaLocalRef<jobject> NTPSnippetsBridge::GetSuggestionsForCategory( |
| JNIEnv* env, |
| const base::android::JavaParamRef<jobject>& obj, |
| jint category) { |
| + // Get layout for the category. |
| + base::Optional<CategoryInfo> info = |
| + content_suggestions_service_->GetCategoryInfo( |
| + content_suggestions_service_->category_factory()->FromIDValue( |
| + category)); |
| + int layout = static_cast<int>(info ? info->card_layout() |
|
Bernhard Bauer
2016/08/11 15:22:24
I'm not sure we need to deal with the category inf
PEConn
2016/08/11 16:30:10
Done.
|
| + : ntp_snippets::ContentSuggestionsCardLayout::FULL_CARD); |
| + |
| const std::vector<ContentSuggestion>& suggestions = |
| content_suggestions_service_->GetSuggestionsForCategory( |
| content_suggestions_service_->category_factory()->FromIDValue( |
| @@ -162,7 +170,7 @@ ScopedJavaLocalRef<jobject> NTPSnippetsBridge::GetSuggestionsForCategory( |
| ConvertUTF16ToJavaString(env, suggestion.snippet_text()).obj(), |
| ConvertUTF8ToJavaString(env, suggestion.url().spec()).obj(), |
| ConvertUTF8ToJavaString(env, suggestion.amp_url().spec()).obj(), |
| - suggestion.publish_date().ToJavaTime(), suggestion.score()); |
| + suggestion.publish_date().ToJavaTime(), suggestion.score(), layout); |
| } |
| return result; |
| } |