| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/android/ntp/ntp_snippets_bridge.h" | 5 #include "chrome/browser/android/ntp/ntp_snippets_bridge.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 Java_SnippetsBridge_setOfflinePageDownloadDataForSuggestion( | 80 Java_SnippetsBridge_setOfflinePageDownloadDataForSuggestion( |
| 81 env, java_suggestion, | 81 env, java_suggestion, |
| 82 suggestion.download_suggestion_extra()->offline_page_id); | 82 suggestion.download_suggestion_extra()->offline_page_id); |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 if (suggestion.id().category().IsKnownCategory( | 85 if (suggestion.id().category().IsKnownCategory( |
| 86 KnownCategories::RECENT_TABS) && | 86 KnownCategories::RECENT_TABS) && |
| 87 suggestion.recent_tab_suggestion_extra() != nullptr) { | 87 suggestion.recent_tab_suggestion_extra() != nullptr) { |
| 88 Java_SnippetsBridge_setRecentTabDataForSuggestion( | 88 Java_SnippetsBridge_setRecentTabDataForSuggestion( |
| 89 env, java_suggestion, | 89 env, java_suggestion, |
| 90 ConvertUTF8ToJavaString( | 90 suggestion.recent_tab_suggestion_extra()->tab_id, |
| 91 env, suggestion.recent_tab_suggestion_extra()->tab_id), | |
| 92 suggestion.recent_tab_suggestion_extra()->offline_page_id); | 91 suggestion.recent_tab_suggestion_extra()->offline_page_id); |
| 93 } | 92 } |
| 94 } | 93 } |
| 95 | 94 |
| 96 return result; | 95 return result; |
| 97 } | 96 } |
| 98 | 97 |
| 99 ntp_snippets::RemoteSuggestionsScheduler* GetRemoteSuggestionsScheduler() { | 98 ntp_snippets::RemoteSuggestionsScheduler* GetRemoteSuggestionsScheduler() { |
| 100 ntp_snippets::ContentSuggestionsService* content_suggestions_service = | 99 ntp_snippets::ContentSuggestionsService* content_suggestions_service = |
| 101 ContentSuggestionsServiceFactory::GetForProfile( | 100 ContentSuggestionsServiceFactory::GetForProfile( |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 JNIEnv* env = AttachCurrentThread(); | 484 JNIEnv* env = AttachCurrentThread(); |
| 486 Java_SnippetsBridge_onMoreSuggestions( | 485 Java_SnippetsBridge_onMoreSuggestions( |
| 487 env, bridge_, category.id(), | 486 env, bridge_, category.id(), |
| 488 ToJavaSuggestionList(env, category, suggestions)); | 487 ToJavaSuggestionList(env, category, suggestions)); |
| 489 } | 488 } |
| 490 | 489 |
| 491 // static | 490 // static |
| 492 bool NTPSnippetsBridge::Register(JNIEnv* env) { | 491 bool NTPSnippetsBridge::Register(JNIEnv* env) { |
| 493 return RegisterNativesImpl(env); | 492 return RegisterNativesImpl(env); |
| 494 } | 493 } |
| OLD | NEW |