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

Side by Side Diff: chrome/browser/interests/android/interests_service.cc

Issue 1459593002: Added a UI for the Interests Prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 2015 The Chromium Authors. All rights reserved. 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 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/interests/android/interests_service.h" 5 #include "chrome/browser/interests/android/interests_service.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return RegisterNativesImpl(env); 79 return RegisterNativesImpl(env);
80 } 80 }
81 81
82 void InterestsService::OnObtainedInterests( 82 void InterestsService::OnObtainedInterests(
83 scoped_ptr<InterestsFetcher> fetcher, 83 scoped_ptr<InterestsFetcher> fetcher,
84 const ScopedJavaGlobalRef<jobject>& j_callback, 84 const ScopedJavaGlobalRef<jobject>& j_callback,
85 scoped_ptr<std::vector<InterestsFetcher::Interest>> interests) { 85 scoped_ptr<std::vector<InterestsFetcher::Interest>> interests) {
86 JNIEnv* env = AttachCurrentThread(); 86 JNIEnv* env = AttachCurrentThread();
87 ScopedJavaLocalRef<jobjectArray> j_interests = 87 ScopedJavaLocalRef<jobjectArray> j_interests =
88 ConvertInterestsToJava(env, interests.Pass()); 88 ConvertInterestsToJava(env, interests.Pass());
89 Java_GetInterestsCallback_onInterestsAvailableCallback(env, 89 Java_GetInterestsCallback_onInterestsAvailable(env,
90 j_callback.obj(), 90 j_callback.obj(),
91 j_interests.obj()); 91 j_interests.obj());
92 } 92 }
93 93
94 static jlong Init(JNIEnv* env, 94 static jlong Init(JNIEnv* env,
95 const JavaParamRef<jobject>& jobj, 95 const JavaParamRef<jobject>& jobj,
96 const JavaParamRef<jobject>& jprofile) { 96 const JavaParamRef<jobject>& jprofile) {
97 InterestsService* interests_service = 97 InterestsService* interests_service =
98 new InterestsService(ProfileAndroid::FromProfileAndroid(jprofile)); 98 new InterestsService(ProfileAndroid::FromProfileAndroid(jprofile));
99 return reinterpret_cast<intptr_t>(interests_service); 99 return reinterpret_cast<intptr_t>(interests_service);
100 } 100 }
OLDNEW
« no previous file with comments | « chrome/android/java/strings/android_chrome_strings.grd ('k') | chrome/browser/interests/interests_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698