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

Side by Side Diff: chrome/browser/android/ntp/ntp_snippets_controller.cc

Issue 1811333003: Move the remaining NTP realted files to c/b/android/ntp subdir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 unified diff | Download patch
OLDNEW
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_snippets_controller.h" 5 #include "chrome/browser/android/ntp/ntp_snippets_controller.h"
6 6
7 #include <jni.h> 7 #include <jni.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
11 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h" 11 #include "chrome/browser/ntp_snippets/ntp_snippets_service_factory.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/profiles/profile_android.h" 13 #include "chrome/browser/profiles/profile_android.h"
14 #include "components/ntp_snippets/ntp_snippets_service.h" 14 #include "components/ntp_snippets/ntp_snippets_service.h"
15 #include "jni/SnippetsController_jni.h" 15 #include "jni/SnippetsController_jni.h"
16 16
17 using base::android::JavaParamRef; 17 using base::android::JavaParamRef;
18 18
19 static void FetchSnippets(JNIEnv* env, 19 static void FetchSnippets(JNIEnv* env,
20 const JavaParamRef<jobject>& obj, 20 const JavaParamRef<jobject>& obj,
21 const JavaParamRef<jobject>& jprofile) { 21 const JavaParamRef<jobject>& jprofile) {
22 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile); 22 Profile* profile = ProfileAndroid::FromProfileAndroid(jprofile);
23 if (profile) { 23 if (profile) {
24 ntp_snippets::NTPSnippetsService* ntp_snippets_service = 24 ntp_snippets::NTPSnippetsService* ntp_snippets_service =
25 NTPSnippetsServiceFactory::GetForProfile(profile); 25 NTPSnippetsServiceFactory::GetForProfile(profile);
26 ntp_snippets_service->FetchSnippets(); 26 ntp_snippets_service->FetchSnippets();
27 } 27 }
28 } 28 }
29 29
30 // static 30 // static
31 bool NTPSnippetsController::Register(JNIEnv* env) { 31 bool NTPSnippetsController::Register(JNIEnv* env) {
32 return RegisterNativesImpl(env); 32 return RegisterNativesImpl(env);
33 } 33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698