OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ |
6 #define CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "components/content_settings/core/common/content_settings.h" | 11 #include "components/content_settings/core/common/content_settings.h" |
12 | 12 |
13 class PrefServiceBridge { | 13 class PrefServiceBridge { |
14 public: | 14 public: |
15 static bool RegisterPrefServiceBridge(JNIEnv* env); | 15 static bool RegisterPrefServiceBridge(JNIEnv* env); |
16 | 16 |
17 // Use |locale| to create a language-region pair and language code to prepend | 17 // Use |locale| to create a language-region pair and language code to prepend |
18 // to the default accept languages. For Malay, we'll end up creating | 18 // to the default accept languages. For Malay, we'll end up creating |
19 // "ms-MY,ms,en-US,en", and for Swiss-German, we will have | 19 // "ms-MY,ms,en-US,en", and for Swiss-German, we will have |
20 // "de-CH,de-DE,de,en-US,en". | 20 // "de-CH,de-DE,de,en-US,en". |
21 static void PrependToAcceptLanguagesIfNecessary( | 21 static void PrependToAcceptLanguagesIfNecessary( |
22 const std::string& locale, | 22 const std::string& locale, |
23 std::string* accept_languages); | 23 std::string* accept_languages); |
24 | 24 |
25 // Return the corresponding Android permission associated with the | 25 // Return the corresponding Android permission associated with the |
26 // ContentSettingsType specified (or an empty string if no permission exists). | 26 // ContentSettingsType specified (or an empty string if no permission exists). |
27 static std::string GetAndroidPermissionForContentSetting( | 27 static std::string GetAndroidPermissionForContentSetting( |
28 ContentSettingsType content_type); | 28 ContentSettingsType content_type); |
| 29 |
| 30 // Used to pull the first run seed parameters |
| 31 // (seed signature and country code) |
| 32 static std::string PullVariationsSeedPref(const std::string& prefName); |
| 33 |
| 34 private: |
| 35 // Used to pull the first run seed in raw format as an array of bytes. |
| 36 // It is private since it is being called from PullVariationsSeedPref(). |
| 37 static std::string PullRawVariationsSeed(); |
29 }; | 38 }; |
30 | 39 |
31 #endif // CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ | 40 #endif // CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ |
OLD | NEW |