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

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

Issue 1372353004: Making structure for ContentSettings and its corresponding strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 2 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 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 case CONTENT_SETTING_BLOCK: 68 case CONTENT_SETTING_BLOCK:
69 return false; 69 return false;
70 case CONTENT_SETTING_ALLOW: 70 case CONTENT_SETTING_ALLOW:
71 return true; 71 return true;
72 case CONTENT_SETTING_ASK: 72 case CONTENT_SETTING_ASK:
73 default: 73 default:
74 return true; 74 return true;
75 } 75 }
76 } 76 }
77 77
78 std::string GetStringForContentSettingsType( 78 std::string GetStringForContentSettingsType(
Bernhard Bauer 2015/10/07 11:38:21 Thanks for finding these! I took a look at this m
Deepak 2015/10/07 13:54:43 Acknowledged.
79 ContentSetting content_setting) { 79 ContentSetting content_setting) {
80 switch (content_setting) { 80 switch (content_setting) {
81 case CONTENT_SETTING_BLOCK: 81 case CONTENT_SETTING_BLOCK:
82 return "block"; 82 return "block";
83 case CONTENT_SETTING_ALLOW: 83 case CONTENT_SETTING_ALLOW:
84 return "allow"; 84 return "allow";
85 case CONTENT_SETTING_ASK: 85 case CONTENT_SETTING_ASK:
86 return "ask"; 86 return "ask";
87 case CONTENT_SETTING_SESSION_ONLY: 87 case CONTENT_SETTING_SESSION_ONLY:
88 return "session"; 88 return "session_only";
89 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT: 89 case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT:
90 return "detect"; 90 return "detect_important_content";
91 case CONTENT_SETTING_NUM_SETTINGS: 91 case CONTENT_SETTING_NUM_SETTINGS:
92 return "num_settings"; 92 return "num_settings";
93 case CONTENT_SETTING_DEFAULT: 93 case CONTENT_SETTING_DEFAULT:
94 default: 94 default:
95 return "default"; 95 return "default";
96 } 96 }
97 } 97 }
98 98
99 bool IsContentSettingManaged(ContentSettingsType content_settings_type) { 99 bool IsContentSettingManaged(ContentSettingsType content_settings_type) {
100 std::string source; 100 std::string source;
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 ContentSettingsType content_type) { 967 ContentSettingsType content_type) {
968 JNIEnv* env = AttachCurrentThread(); 968 JNIEnv* env = AttachCurrentThread();
969 base::android::ScopedJavaLocalRef<jstring> android_permission = 969 base::android::ScopedJavaLocalRef<jstring> android_permission =
970 Java_PrefServiceBridge_getAndroidPermissionForContentSetting( 970 Java_PrefServiceBridge_getAndroidPermissionForContentSetting(
971 env, content_type); 971 env, content_type);
972 if (android_permission.is_null()) 972 if (android_permission.is_null())
973 return std::string(); 973 return std::string();
974 974
975 return ConvertJavaStringToUTF8(android_permission); 975 return ConvertJavaStringToUTF8(android_permission);
976 } 976 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698