OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 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_ANDROID_LOCALE_SPECIAL_LOCALE_HANDLER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_LOCALE_SPECIAL_LOCALE_HANDLER_H_ |
| 7 |
| 8 #include <jni.h> |
| 9 |
| 10 #include "base/android/scoped_java_ref.h" |
| 11 #include "base/macros.h" |
| 12 #include "components/search_engines/template_url.h" |
| 13 |
| 14 using base::android::JavaParamRef; |
| 15 |
| 16 class TemplateURLService; |
| 17 |
| 18 class SpecialLocaleHandler { |
| 19 public: |
| 20 explicit SpecialLocaleHandler(const std::string& locale); |
| 21 void Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj); |
| 22 jboolean LoadTemplateUrls(JNIEnv* env, const JavaParamRef<jobject>& obj); |
| 23 void RemoveTemplateUrls(JNIEnv* env, const JavaParamRef<jobject>& obj); |
| 24 void OverrideDefaultSearchProvider(JNIEnv* env, |
| 25 const JavaParamRef<jobject>& obj); |
| 26 |
| 27 private: |
| 28 virtual ~SpecialLocaleHandler(); |
| 29 |
| 30 std::string locale_; |
| 31 |
| 32 // Tracks all local search engines that were added to TURL service. |
| 33 std::vector<int> prepopulate_ids_; |
| 34 |
| 35 // Pointer to the TemplateUrlService for the main profile. |
| 36 TemplateURLService* template_url_service_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(SpecialLocaleHandler); |
| 39 }; |
| 40 |
| 41 bool RegisterSpecialLocaleHandler(JNIEnv* env); |
| 42 |
| 43 #endif // CHROME_BROWSER_ANDROID_LOCALE_SPECIAL_LOCALE_HANDLER_H_ |
OLD | NEW |