| OLD | NEW |
| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
| 15 #include "chrome/browser/search_engines/template_url_service_factory.h" | 15 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 16 #include "components/google/core/browser/google_util.h" | 16 #include "components/google/core/browser/google_util.h" |
| 17 #include "components/search_engines/search_terms_data.h" | 17 #include "components/search_engines/search_terms_data.h" |
| 18 #include "components/search_engines/template_url.h" | 18 #include "components/search_engines/template_url.h" |
| 19 #include "components/search_engines/template_url_prepopulate_data.h" | 19 #include "components/search_engines/template_url_prepopulate_data.h" |
| 20 #include "components/search_engines/template_url_service.h" | 20 #include "components/search_engines/template_url_service.h" |
| 21 #include "components/search_engines/util.h" | 21 #include "components/search_engines/util.h" |
| 22 #include "jni/TemplateUrlService_jni.h" | 22 #include "jni/TemplateUrlService_jni.h" |
| 23 #include "net/base/url_util.h" | 23 #include "net/base/url_util.h" |
| 24 | 24 |
| 25 using base::android::JavaParamRef; |
| 26 using base::android::ScopedJavaLocalRef; |
| 27 |
| 25 namespace { | 28 namespace { |
| 26 | 29 |
| 27 Profile* GetOriginalProfile() { | 30 Profile* GetOriginalProfile() { |
| 28 return ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); | 31 return ProfileManager::GetActiveUserProfile()->GetOriginalProfile(); |
| 29 } | 32 } |
| 30 | 33 |
| 31 } // namespace | 34 } // namespace |
| 32 | 35 |
| 33 TemplateUrlServiceAndroid::TemplateUrlServiceAndroid(JNIEnv* env, | 36 TemplateUrlServiceAndroid::TemplateUrlServiceAndroid(JNIEnv* env, |
| 34 jobject obj) | 37 jobject obj) |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 275 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 278 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
| 276 TemplateUrlServiceAndroid* template_url_service_android = | 279 TemplateUrlServiceAndroid* template_url_service_android = |
| 277 new TemplateUrlServiceAndroid(env, obj); | 280 new TemplateUrlServiceAndroid(env, obj); |
| 278 return reinterpret_cast<intptr_t>(template_url_service_android); | 281 return reinterpret_cast<intptr_t>(template_url_service_android); |
| 279 } | 282 } |
| 280 | 283 |
| 281 // static | 284 // static |
| 282 bool TemplateUrlServiceAndroid::Register(JNIEnv* env) { | 285 bool TemplateUrlServiceAndroid::Register(JNIEnv* env) { |
| 283 return RegisterNativesImpl(env); | 286 return RegisterNativesImpl(env); |
| 284 } | 287 } |
| OLD | NEW |