| Index: chrome/browser/android/preferences/pref_service_bridge.cc
|
| diff --git a/chrome/browser/android/preferences/pref_service_bridge.cc b/chrome/browser/android/preferences/pref_service_bridge.cc
|
| index b0e8aecab6666a6c4c75c53ef503d7a894463d95..cf6108c887bb63f53d00aba6420f04c6937cea16 100644
|
| --- a/chrome/browser/android/preferences/pref_service_bridge.cc
|
| +++ b/chrome/browser/android/preferences/pref_service_bridge.cc
|
| @@ -104,6 +104,17 @@ bool IsContentSettingManaged(ContentSettingsType content_settings_type) {
|
| return provider == HostContentSettingsMap::POLICY_PROVIDER;
|
| }
|
|
|
| +bool IsContentSettingManagedByCustodian(
|
| + ContentSettingsType content_settings_type) {
|
| + std::string source;
|
| + HostContentSettingsMap* content_settings =
|
| + GetOriginalProfile()->GetHostContentSettingsMap();
|
| + content_settings->GetDefaultContentSetting(content_settings_type, &source);
|
| + HostContentSettingsMap::ProviderType provider =
|
| + content_settings->GetProviderTypeFromSource(source);
|
| + return provider == HostContentSettingsMap::SUPERVISED_PROVIDER;
|
| +}
|
| +
|
| bool IsContentSettingUserModifiable(ContentSettingsType content_settings_type) {
|
| std::string source;
|
| HostContentSettingsMap* content_settings =
|
| @@ -230,8 +241,7 @@ static jboolean GetAllowLocationUserModifiable(JNIEnv* env, jobject obj) {
|
| }
|
|
|
| static jboolean GetAllowLocationManagedByCustodian(JNIEnv* env, jobject obj) {
|
| - return GetPrefService()->IsPreferenceManagedByCustodian(
|
| - prefs::kGeolocationEnabled);
|
| + return IsContentSettingManagedByCustodian(CONTENT_SETTINGS_TYPE_GEOLOCATION);
|
| }
|
|
|
| static jboolean GetResolveNavigationErrorEnabled(JNIEnv* env, jobject obj) {
|
| @@ -467,12 +477,7 @@ static jboolean GetCameraMicUserModifiable(JNIEnv* env, jobject obj) {
|
| }
|
|
|
| static jboolean GetCameraMicManagedByCustodian(JNIEnv* env, jobject obj) {
|
| - PrefService* prefs = GetPrefService();
|
| - if (prefs->IsPreferenceManagedByCustodian(prefs::kVideoCaptureAllowed))
|
| - return true;
|
| - if (prefs->IsPreferenceManagedByCustodian(prefs::kAudioCaptureAllowed))
|
| - return true;
|
| - return false;
|
| + return IsContentSettingManagedByCustodian(CONTENT_SETTINGS_TYPE_MEDIASTREAM);
|
| }
|
|
|
| static jboolean GetAutologinEnabled(JNIEnv* env, jobject obj) {
|
|
|