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

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

Issue 2938163002: Store base::Value in ContentSettingPatternSource instead of an enum (Closed)
Patch Set: rebased Created 3 years, 5 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 9
10 #include <memory> 10 #include <memory>
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 const JavaParamRef<jobject>& list) { 186 const JavaParamRef<jobject>& list) {
187 HostContentSettingsMap* host_content_settings_map = 187 HostContentSettingsMap* host_content_settings_map =
188 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile()); 188 HostContentSettingsMapFactory::GetForProfile(GetOriginalProfile());
189 ContentSettingsForOneType entries; 189 ContentSettingsForOneType entries;
190 host_content_settings_map->GetSettingsForOneType( 190 host_content_settings_map->GetSettingsForOneType(
191 static_cast<ContentSettingsType>(content_settings_type), "", &entries); 191 static_cast<ContentSettingsType>(content_settings_type), "", &entries);
192 for (size_t i = 0; i < entries.size(); ++i) { 192 for (size_t i = 0; i < entries.size(); ++i) {
193 Java_PrefServiceBridge_addContentSettingExceptionToList( 193 Java_PrefServiceBridge_addContentSettingExceptionToList(
194 env, list, content_settings_type, 194 env, list, content_settings_type,
195 ConvertUTF8ToJavaString(env, entries[i].primary_pattern.ToString()), 195 ConvertUTF8ToJavaString(env, entries[i].primary_pattern.ToString()),
196 entries[i].setting, ConvertUTF8ToJavaString(env, entries[i].source)); 196 entries[i].GetContentSetting(),
197 ConvertUTF8ToJavaString(env, entries[i].source));
197 } 198 }
198 } 199 }
199 200
200 static jboolean GetAcceptCookiesEnabled(JNIEnv* env, 201 static jboolean GetAcceptCookiesEnabled(JNIEnv* env,
201 const JavaParamRef<jobject>& obj) { 202 const JavaParamRef<jobject>& obj) {
202 return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_COOKIES); 203 return GetBooleanForContentSetting(CONTENT_SETTINGS_TYPE_COOKIES);
203 } 204 }
204 205
205 static jboolean GetAcceptCookiesUserModifiable( 206 static jboolean GetAcceptCookiesUserModifiable(
206 JNIEnv* env, 207 JNIEnv* env,
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 .obj(), 1014 .obj(),
1014 out); 1015 out);
1015 } 1016 }
1016 1017
1017 static void SetSupervisedUserId(JNIEnv* env, 1018 static void SetSupervisedUserId(JNIEnv* env,
1018 const JavaParamRef<jobject>& obj, 1019 const JavaParamRef<jobject>& obj,
1019 const JavaParamRef<jstring>& pref) { 1020 const JavaParamRef<jstring>& pref) {
1020 GetPrefService()->SetString(prefs::kSupervisedUserId, 1021 GetPrefService()->SetString(prefs::kSupervisedUserId,
1021 ConvertJavaStringToUTF8(env, pref)); 1022 ConvertJavaStringToUTF8(env, pref));
1022 } 1023 }
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