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

Side by Side Diff: chrome/browser/android/locale/special_locale_handler.h

Issue 2347973002: Enable Chrome to tweak search engines for some locales (Closed)
Patch Set: final nits Created 4 years, 2 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 unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698