| 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 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } | 77 } |
| 78 } | 78 } |
| 79 | 79 |
| 80 bool IsContentSettingManaged(ContentSettingsType content_settings_type) { | 80 bool IsContentSettingManaged(ContentSettingsType content_settings_type) { |
| 81 std::string source; | 81 std::string source; |
| 82 HostContentSettingsMap* content_settings = | 82 HostContentSettingsMap* content_settings = |
| 83 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); | 83 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); |
| 84 content_settings->GetDefaultContentSetting(content_settings_type, &source); | 84 content_settings->GetDefaultContentSetting(content_settings_type, &source); |
| 85 HostContentSettingsMap::ProviderType provider = | 85 HostContentSettingsMap::ProviderType provider = |
| 86 content_settings->GetProviderTypeFromSource(source); | 86 content_settings->GetProviderTypeFromSource(source); |
| 87 return provider == HostContentSettingsMap::POLICY_PROVIDER; | 87 return provider == HostContentSettingsMap::POLICY_PROVIDER || |
| 88 provider == HostContentSettingsMap::RECOMMENDED_POLICY_PROVIDER; |
| 88 } | 89 } |
| 89 | 90 |
| 90 bool IsContentSettingManagedByCustodian( | 91 bool IsContentSettingManagedByCustodian( |
| 91 ContentSettingsType content_settings_type) { | 92 ContentSettingsType content_settings_type) { |
| 92 std::string source; | 93 std::string source; |
| 93 HostContentSettingsMap* content_settings = | 94 HostContentSettingsMap* content_settings = |
| 94 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); | 95 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); |
| 95 content_settings->GetDefaultContentSetting(content_settings_type, &source); | 96 content_settings->GetDefaultContentSetting(content_settings_type, &source); |
| 96 HostContentSettingsMap::ProviderType provider = | 97 HostContentSettingsMap::ProviderType provider = |
| 97 content_settings->GetProviderTypeFromSource(source); | 98 content_settings->GetProviderTypeFromSource(source); |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 | 1009 |
| 1009 return ConvertJavaStringToUTF8(android_permission); | 1010 return ConvertJavaStringToUTF8(android_permission); |
| 1010 } | 1011 } |
| 1011 | 1012 |
| 1012 static void SetSupervisedUserId(JNIEnv* env, | 1013 static void SetSupervisedUserId(JNIEnv* env, |
| 1013 const JavaParamRef<jobject>& obj, | 1014 const JavaParamRef<jobject>& obj, |
| 1014 const JavaParamRef<jstring>& pref) { | 1015 const JavaParamRef<jstring>& pref) { |
| 1015 GetPrefService()->SetString(prefs::kSupervisedUserId, | 1016 GetPrefService()->SetString(prefs::kSupervisedUserId, |
| 1016 ConvertJavaStringToUTF8(env, pref)); | 1017 ConvertJavaStringToUTF8(env, pref)); |
| 1017 } | 1018 } |
| OLD | NEW |