Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_ANDROID_H_ | |
| 6 #define CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_ANDROID_H_ | |
| 7 | |
| 8 #include "base/android/jni_helper.h" | |
| 9 #include "base/android/scoped_java_ref.h" | |
| 10 #include "content/public/browser/notification_observer.h" | |
| 11 #include "content/public/browser/notification_registrar.h" | |
| 12 | |
| 13 class TemplateURLService; | |
| 14 | |
| 15 | |
| 16 // Android wrapper of the TemplateUrlService which provides access from the Java | |
| 17 // layer. Note that on Android, there's only a single profile, and therefore | |
| 18 // a single instance of this wrapper. | |
| 19 class TemplateUrlServiceAndroid : public content::NotificationObserver { | |
| 20 public: | |
| 21 TemplateUrlServiceAndroid(JNIEnv* env, jobject obj); | |
| 22 | |
| 23 void Load(JNIEnv* env, jobject obj); | |
| 24 | |
|
Peter Kasting
2013/02/20 05:31:07
Nit: Why all these blank lines between each functi
Yaron
2013/02/21 21:39:15
Done.
| |
| 25 void SetSearchEngine(JNIEnv* env, jobject obj, jint selected_index); | |
| 26 | |
| 27 jint GetSearchEngine(JNIEnv* env, jobject obj); | |
| 28 | |
| 29 jboolean IsLoaded(JNIEnv* env, jobject obj); | |
| 30 | |
| 31 base::android::ScopedJavaLocalRef<jobjectArray> | |
| 32 GetLocalizedSearchEngines(JNIEnv* env, jobject obj); | |
|
Peter Kasting
2013/02/20 05:31:07
Nit: Indent 4
Yaron
2013/02/21 21:39:15
Done.
| |
| 33 | |
| 34 // NotificationObserver: | |
| 35 virtual void Observe(int type, | |
| 36 const content::NotificationSource& source, | |
| 37 const content::NotificationDetails& details) OVERRIDE; | |
| 38 | |
| 39 static bool Register(JNIEnv* env); | |
| 40 | |
| 41 private: | |
| 42 virtual ~TemplateUrlServiceAndroid(); | |
| 43 JavaObjectWeakGlobalRef weak_java_obj_; | |
|
Peter Kasting
2013/02/20 05:31:07
Nit: Add blank line above here
Yaron
2013/02/21 21:39:15
Done.
| |
| 44 content::NotificationRegistrar registrar_; | |
| 45 | |
| 46 // Pointer to the TemplateUrlService for the main profile. | |
| 47 TemplateURLService* template_url_service_; | |
| 48 DISALLOW_COPY_AND_ASSIGN(TemplateUrlServiceAndroid); | |
|
Peter Kasting
2013/02/20 05:31:07
Nit: And here
Yaron
2013/02/21 21:39:15
Done.
| |
| 49 }; | |
| 50 | |
| 51 #endif // CHROME_BROWSER_SEARCH_ENGINES_TEMPLATE_URL_SERVICE_ANDROID_H_ | |
| OLD | NEW |