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

Unified Diff: chrome/browser/android/locale/special_locale_handler.h

Issue 2347973002: Enable Chrome to tweak search engines for some locales (Closed)
Patch Set: fix compile Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/locale/special_locale_handler.h
diff --git a/chrome/browser/android/locale/special_locale_handler.h b/chrome/browser/android/locale/special_locale_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f9f83928b36f966f72213209a235eb7d0ab7707
--- /dev/null
+++ b/chrome/browser/android/locale/special_locale_handler.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_ANDROID_LOCALE_SPECIAL_LOCALE_HANDLER_H_
+#define CHROME_BROWSER_ANDROID_LOCALE_SPECIAL_LOCALE_HANDLER_H_
+
+#include <jni.h>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/macros.h"
+#include "components/search_engines/template_url.h"
+
+using base::android::JavaParamRef;
+using std::string;
+using std::vector;
+
+class TemplateURLService;
+
+class SpecialLocaleHandler {
+ public:
+ explicit SpecialLocaleHandler(const string& locale);
+ void Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj);
+ jboolean LoadTemplateUrls(JNIEnv* env, const JavaParamRef<jobject>& obj);
+ void RemoveTemplateUrls(JNIEnv* env, const JavaParamRef<jobject>& obj);
+ void OverrideDefaultSearchProvider(JNIEnv* env,
+ const JavaParamRef<jobject>& obj);
+
+ private:
+ virtual ~SpecialLocaleHandler();
+
+ string locale_;
+
+ // Tracks all local search engines that were added to TURL service.
+ vector<int> prepopulate_ids_;
+
+ // Pointer to the TemplateUrlService for the main profile.
+ TemplateURLService* template_url_service_;
+
+ DISALLOW_COPY_AND_ASSIGN(SpecialLocaleHandler);
+};
+
+bool RegisterSpecialLocaleHandler(JNIEnv* env);
+
+#endif // CHROME_BROWSER_ANDROID_LOCALE_SPECIAL_LOCALE_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698