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 #include <vector> |
10 | 11 |
11 #include "components/content_settings/core/common/content_settings.h" | 12 #include "components/content_settings/core/common/content_settings.h" |
12 | 13 |
13 class PrefServiceBridge { | 14 class PrefServiceBridge { |
14 public: | 15 public: |
15 static bool RegisterPrefServiceBridge(JNIEnv* env); | 16 static bool RegisterPrefServiceBridge(JNIEnv* env); |
16 | 17 |
17 // Use |locale| to create a language-region pair and language code to prepend | 18 // 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 | 19 // 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 | 20 // "ms-MY,ms,en-US,en", and for Swiss-German, we will have |
20 // "de-CH,de-DE,de,en-US,en". | 21 // "de-CH,de-DE,de,en-US,en". |
21 static void PrependToAcceptLanguagesIfNecessary( | 22 static void PrependToAcceptLanguagesIfNecessary( |
22 const std::string& locale, | 23 const std::string& locale, |
23 std::string* accept_languages); | 24 std::string* accept_languages); |
24 | 25 |
25 // Return the corresponding Android permission associated with the | 26 // Populate the list of corresponding Android permissions associated with the |
26 // ContentSettingsType specified (or an empty string if no permission exists). | 27 // ContentSettingsType specified. |
27 static std::string GetAndroidPermissionForContentSetting( | 28 static void GetAndroidPermissionsForContentSetting( |
28 ContentSettingsType content_type); | 29 ContentSettingsType content_type, |
| 30 std::vector<std::string>* out); |
29 }; | 31 }; |
30 | 32 |
31 #endif // CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ | 33 #endif // CHROME_BROWSER_ANDROID_PREFERENCES_PREF_SERVICE_BRIDGE_H_ |
OLD | NEW |