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

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

Issue 1871583002: [NTP Snippets] Merge SnippetsController into SnippetsBridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@snippets_bridge_cleanup
Patch Set: review Created 4 years, 8 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 471053d0f00ebb5e2433ac3e0bb2b158a523f2f8..b1154ceb7fe7c429fdbc60cd003f62fc899a03ac 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -13,6 +13,7 @@
#include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_android.h"
+#include "chrome/browser/profiles/profile_manager.h"
#include "components/ntp_snippets/ntp_snippet.h"
#include "components/ntp_snippets/ntp_snippets_service.h"
#include "jni/SnippetsBridge_jni.h"
@@ -29,6 +30,12 @@ static jlong Init(JNIEnv* env,
return reinterpret_cast<intptr_t>(snippets_bridge);
}
+static void FetchSnippets(JNIEnv* env,
+ const JavaParamRef<jclass>& caller) {
+ Profile* profile = ProfileManager::GetLastUsedProfile();
+ NTPSnippetsServiceFactory::GetForProfile(profile)->FetchSnippets();
+}
+
NTPSnippetsBridge::NTPSnippetsBridge(JNIEnv* env,
const JavaParamRef<jobject>& j_profile)
: snippet_service_observer_(this) {
« no previous file with comments | « chrome/browser/android/chrome_jni_registrar.cc ('k') | chrome/browser/android/ntp/ntp_snippets_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698