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 7f03d7f224e8761dee9f3aaaa40116b60adf40e3..3fb66a599003ab0445e67e70978bfbb17c06f7d8 100644 |
| --- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| +++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc |
| @@ -81,15 +81,21 @@ ScopedJavaLocalRef<jobject> ToJavaSuggestionList( |
| static_cast<int>(info->card_layout())); |
| if (suggestion.id().category().IsKnownCategory( |
| KnownCategories::DOWNLOADS) && |
| - suggestion.download_suggestion_extra() != nullptr && |
| - suggestion.download_suggestion_extra()->is_download_asset) { |
| - Java_SnippetsBridge_setDownloadAssetDataForLastSuggestion( |
| - env, result, |
| - ConvertUTF8ToJavaString( |
| - env, |
| - suggestion.download_suggestion_extra()->target_file_path.value()), |
| - ConvertUTF8ToJavaString( |
| - env, suggestion.download_suggestion_extra()->mime_type)); |
| + suggestion.download_suggestion_extra() != nullptr) { |
| + if (suggestion.download_suggestion_extra()->is_download_asset) { |
| + Java_SnippetsBridge_setDownloadAssetDataForLastSuggestion( |
| + env, result, |
| + ConvertUTF8ToJavaString(env, suggestion.download_suggestion_extra() |
| + ->target_file_path.value()), |
| + ConvertUTF8ToJavaString( |
| + env, suggestion.download_suggestion_extra()->mime_type)); |
| + } else { |
| + // TODO(vitaliii): Pass |offline_page_id| as a numeric variable. |
|
Bernhard Bauer
2016/11/16 17:04:02
Any particular reason you're not doing that now?
vitaliii
2016/11/16 17:28:10
Neither Mark nor I knew whether this was possible
|
| + Java_SnippetsBridge_setDownloadOfflinePageDataForLastSuggestion( |
|
Bernhard Bauer
2016/11/16 17:04:02
I realize this is just following existing code, bu
vitaliii
2016/11/16 17:28:10
I added a TODO (as per your following comment).
|
| + env, result, |
| + ConvertUTF8ToJavaString( |
| + env, suggestion.download_suggestion_extra()->offline_page_id)); |
| + } |
| } |
| if (suggestion.id().category().IsKnownCategory( |
| KnownCategories::RECENT_TABS) && |