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

Side by Side Diff: chrome/browser/search_engines/template_url_service_android.cc

Issue 1312153003: jni_generator: Pass object parameters as JavaParamRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 3 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/search_engines/template_url_service_android.h" 5 #include "chrome/browser/search_engines/template_url_service_android.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 JNIEnv* env, 250 JNIEnv* env,
251 jobject obj, 251 jobject obj,
252 jint index) { 252 jint index) {
253 TemplateURL* template_url = template_url_service_->GetTemplateURLs()[index]; 253 TemplateURL* template_url = template_url_service_->GetTemplateURLs()[index];
254 std::string url(template_url->url_ref().ReplaceSearchTerms( 254 std::string url(template_url->url_ref().ReplaceSearchTerms(
255 TemplateURLRef::SearchTermsArgs( 255 TemplateURLRef::SearchTermsArgs(
256 base::ASCIIToUTF16("query")), SearchTermsData(), nullptr)); 256 base::ASCIIToUTF16("query")), SearchTermsData(), nullptr));
257 return base::android::ConvertUTF8ToJavaString(env, url); 257 return base::android::ConvertUTF8ToJavaString(env, url);
258 } 258 }
259 259
260 static jlong Init(JNIEnv* env, jobject obj) { 260 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) {
261 TemplateUrlServiceAndroid* template_url_service_android = 261 TemplateUrlServiceAndroid* template_url_service_android =
262 new TemplateUrlServiceAndroid(env, obj); 262 new TemplateUrlServiceAndroid(env, obj);
263 return reinterpret_cast<intptr_t>(template_url_service_android); 263 return reinterpret_cast<intptr_t>(template_url_service_android);
264 } 264 }
265 265
266 // static 266 // static
267 bool TemplateUrlServiceAndroid::Register(JNIEnv* env) { 267 bool TemplateUrlServiceAndroid::Register(JNIEnv* env) {
268 return RegisterNativesImpl(env); 268 return RegisterNativesImpl(env);
269 } 269 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_android.cc ('k') | chrome/browser/signin/oauth2_token_service_delegate_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698