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

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

Issue 67573003: Android: moves chrome/ to use long for JNI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 GURL destination_url(current_url); 168 GURL destination_url(current_url);
169 if (default_provider && !query.empty()) { 169 if (default_provider && !query.empty()) {
170 bool refined_query = default_provider->ReplaceSearchTermsInURL(current_url, 170 bool refined_query = default_provider->ReplaceSearchTermsInURL(current_url,
171 TemplateURLRef::SearchTermsArgs(query), &destination_url); 171 TemplateURLRef::SearchTermsArgs(query), &destination_url);
172 if (refined_query) 172 if (refined_query)
173 return ConvertUTF8ToJavaString(env, destination_url.spec()); 173 return ConvertUTF8ToJavaString(env, destination_url.spec());
174 } 174 }
175 return base::android::ScopedJavaLocalRef<jstring>(env, NULL); 175 return base::android::ScopedJavaLocalRef<jstring>(env, NULL);
176 } 176 }
177 177
178 static jint Init(JNIEnv* env, jobject obj) { 178 static jlong Init(JNIEnv* env, jobject obj) {
179 TemplateUrlServiceAndroid* template_url_service_android = 179 TemplateUrlServiceAndroid* template_url_service_android =
180 new TemplateUrlServiceAndroid(env, obj); 180 new TemplateUrlServiceAndroid(env, obj);
181 return reinterpret_cast<jint>(template_url_service_android); 181 return reinterpret_cast<intptr_t>(template_url_service_android);
182 } 182 }
183 183
184 // static 184 // static
185 bool TemplateUrlServiceAndroid::Register(JNIEnv* env) { 185 bool TemplateUrlServiceAndroid::Register(JNIEnv* env) {
186 return RegisterNativesImpl(env); 186 return RegisterNativesImpl(env);
187 } 187 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_android.cc ('k') | chrome/browser/signin/android_profile_oauth2_token_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698