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

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

Issue 1818843002: Rename SetContentSetting() to SetContentSettingCustomScope() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix comment alignment Created 4 years, 9 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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK); 156 allow ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
157 } 157 }
158 158
159 static void SetContentSettingForPattern(JNIEnv* env, 159 static void SetContentSettingForPattern(JNIEnv* env,
160 const JavaParamRef<jobject>& obj, 160 const JavaParamRef<jobject>& obj,
161 int content_settings_type, 161 int content_settings_type,
162 const JavaParamRef<jstring>& pattern, 162 const JavaParamRef<jstring>& pattern,
163 int setting) { 163 int setting) {
164 HostContentSettingsMap* host_content_settings_map = 164 HostContentSettingsMap* host_content_settings_map =
165 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); 165 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
166 host_content_settings_map->SetContentSetting( 166 host_content_settings_map->SetContentSettingCustomScope(
167 ContentSettingsPattern::FromString(ConvertJavaStringToUTF8(env, pattern)), 167 ContentSettingsPattern::FromString(ConvertJavaStringToUTF8(env, pattern)),
168 ContentSettingsPattern::Wildcard(), 168 ContentSettingsPattern::Wildcard(),
169 static_cast<ContentSettingsType>(content_settings_type), 169 static_cast<ContentSettingsType>(content_settings_type), std::string(),
170 std::string(),
171 static_cast<ContentSetting>(setting)); 170 static_cast<ContentSetting>(setting));
172 } 171 }
173 172
174 static void GetContentSettingsExceptions(JNIEnv* env, 173 static void GetContentSettingsExceptions(JNIEnv* env,
175 const JavaParamRef<jobject>& obj, 174 const JavaParamRef<jobject>& obj,
176 int content_settings_type, 175 int content_settings_type,
177 const JavaParamRef<jobject>& list) { 176 const JavaParamRef<jobject>& list) {
178 HostContentSettingsMap* host_content_settings_map = 177 HostContentSettingsMap* host_content_settings_map =
179 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); 178 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
180 ContentSettingsForOneType entries; 179 ContentSettingsForOneType entries;
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1008 1007
1009 return ConvertJavaStringToUTF8(android_permission); 1008 return ConvertJavaStringToUTF8(android_permission);
1010 } 1009 }
1011 1010
1012 static void SetSupervisedUserId(JNIEnv* env, 1011 static void SetSupervisedUserId(JNIEnv* env,
1013 const JavaParamRef<jobject>& obj, 1012 const JavaParamRef<jobject>& obj,
1014 const JavaParamRef<jstring>& pref) { 1013 const JavaParamRef<jstring>& pref) {
1015 GetPrefService()->SetString(prefs::kSupervisedUserId, 1014 GetPrefService()->SetString(prefs::kSupervisedUserId,
1016 ConvertJavaStringToUTF8(env, pref)); 1015 ConvertJavaStringToUTF8(env, pref));
1017 } 1016 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698