Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: chrome/browser/android/preferences/pref_service_bridge.cc

Issue 1825173003: [Policy Experimental] Add "recommended" policies for URL exceptions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698