Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_ANDROID_INTERESTS_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_ANDROID_INTERESTS_SERVICE_H_ | |
| 7 | |
| 8 #include <jni.h> | |
| 9 | |
| 10 #include "base/android/scoped_java_ref.h" | |
| 11 #include "chrome/browser/interests/interests_fetcher.h" | |
| 12 #include "chrome/browser/profiles/profile.h" | |
| 13 | |
| 14 // Provides a list of user interests to Java | |
| 15 class InterestsService { | |
| 16 public: | |
| 17 explicit InterestsService(Profile *profile); | |
|
Marc Treib
2015/09/11 14:54:25
* goes with the type, also in a few other places
tache
2015/09/11 15:45:09
Done.
| |
| 18 void Destroy(JNIEnv* env, jobject obj); | |
| 19 void OnLoadingComplete(JNIEnv *env, jobject obj); | |
|
Marc Treib
2015/09/11 14:54:25
This method doesn't actually exist, please remove
tache
2015/09/11 15:45:09
Done.
| |
| 20 | |
| 21 void GetInterests(JNIEnv* env, | |
| 22 jobject obj, | |
| 23 jstring token, | |
| 24 jobject j_callback); | |
| 25 | |
| 26 static jobjectArray ConvertInterestsToJava( | |
| 27 const std::vector<InterestsFetcher::Interest>& interests); | |
| 28 | |
| 29 static bool Register(JNIEnv* env); | |
| 30 virtual ~InterestsService(); | |
| 31 | |
| 32 private: | |
| 33 DISALLOW_COPY_AND_ASSIGN(InterestsService); | |
|
Marc Treib
2015/09/11 14:54:25
By convention, this goes right at the end of the c
tache
2015/09/11 15:45:09
Done.
| |
| 34 | |
| 35 void OnObtainedInterests( | |
| 36 InterestsFetcher* fetcher, | |
| 37 scoped_ptr<base::android::ScopedJavaGlobalRef<jobject>> j_callback, | |
| 38 const std::vector<InterestsFetcher::Interest>& interests); | |
| 39 | |
| 40 | |
| 41 Profile *profile_; | |
| 42 | |
| 43 base::WeakPtrFactory<InterestsService> weak_ptr_factory_; | |
| 44 }; | |
| 45 | |
| 46 #endif // CHROME_BROWSER_ANDROID_INTERESTS_SERVICE_H_ | |
| OLD | NEW |