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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
946 ContentSettingsType content_type) { | 946 ContentSettingsType content_type) { |
947 JNIEnv* env = AttachCurrentThread(); | 947 JNIEnv* env = AttachCurrentThread(); |
948 base::android::ScopedJavaLocalRef<jstring> android_permission = | 948 base::android::ScopedJavaLocalRef<jstring> android_permission = |
949 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( | 949 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( |
950 env, content_type); | 950 env, content_type); |
951 if (android_permission.is_null()) | 951 if (android_permission.is_null()) |
952 return std::string(); | 952 return std::string(); |
953 | 953 |
954 return ConvertJavaStringToUTF8(android_permission); | 954 return ConvertJavaStringToUTF8(android_permission); |
955 } | 955 } |
956 | |
957 static void SetSupervisedUserId(JNIEnv* env, | |
958 const JavaParamRef<jobject>& obj, | |
959 const JavaParamRef<jstring>& pref) { | |
960 GetPrefService()->SetString(prefs::kSupervisedUserId, | |
961 ConvertJavaStringToUTF8(env, pref)); | |
962 } | |
OLD | NEW |