Chromium Code Reviews| 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 #include "chrome/browser/android/preferences/pref_service_bridge.h" | 5 #include "chrome/browser/android/preferences/pref_service_bridge.h" |
| 6 | 6 |
| 7 #include <jni.h> | 7 #include <jni.h> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 std::string GetStringForContentSettingsType( | 78 std::string GetStringForContentSettingsType( |
| 79 ContentSetting content_setting) { | 79 ContentSetting content_setting) { |
| 80 switch (content_setting) { | 80 switch (content_setting) { |
| 81 case CONTENT_SETTING_BLOCK: | 81 case CONTENT_SETTING_BLOCK: |
| 82 return "block"; | 82 return "block"; |
| 83 case CONTENT_SETTING_ALLOW: | 83 case CONTENT_SETTING_ALLOW: |
| 84 return "allow"; | 84 return "allow"; |
| 85 case CONTENT_SETTING_ASK: | 85 case CONTENT_SETTING_ASK: |
| 86 return "ask"; | 86 return "ask"; |
| 87 case CONTENT_SETTING_SESSION_ONLY: | 87 case CONTENT_SETTING_SESSION_ONLY: |
| 88 return "session"; | 88 return "session_only"; |
|
Bernhard Bauer
2015/10/05 12:34:28
I think you need to update the corresponding Web U
Deepak
2015/10/05 14:25:32
Done.
| |
| 89 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: | 89 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: |
| 90 return "detect"; | 90 return "detect_important_content"; |
| 91 case CONTENT_SETTING_NUM_SETTINGS: | 91 case CONTENT_SETTING_NUM_SETTINGS: |
| 92 return "num_settings"; | 92 return "num_settings"; |
| 93 case CONTENT_SETTING_DEFAULT: | 93 case CONTENT_SETTING_DEFAULT: |
| 94 default: | 94 default: |
| 95 return "default"; | 95 return "default"; |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool IsContentSettingManaged(ContentSettingsType content_settings_type) { | 99 bool IsContentSettingManaged(ContentSettingsType content_settings_type) { |
| 100 std::string source; | 100 std::string source; |
| (...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 967 ContentSettingsType content_type) { | 967 ContentSettingsType content_type) { |
| 968 JNIEnv* env = AttachCurrentThread(); | 968 JNIEnv* env = AttachCurrentThread(); |
| 969 base::android::ScopedJavaLocalRef<jstring> android_permission = | 969 base::android::ScopedJavaLocalRef<jstring> android_permission = |
| 970 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( | 970 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( |
| 971 env, content_type); | 971 env, content_type); |
| 972 if (android_permission.is_null()) | 972 if (android_permission.is_null()) |
| 973 return std::string(); | 973 return std::string(); |
| 974 | 974 |
| 975 return ConvertJavaStringToUTF8(android_permission); | 975 return ConvertJavaStringToUTF8(android_permission); |
| 976 } | 976 } |
| OLD | NEW |