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

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

Issue 1432573002: Adding <keygen> Content Setting (Android UI) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@keygen_ui
Patch Set: Fixing android typos. Created 5 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/website_preference_bridge.h" 5 #include "chrome/browser/android/preferences/website_preference_bridge.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 env, list, jorigin.obj(), jembedder.obj()); 109 env, list, jorigin.obj(), jembedder.obj());
110 break; 110 break;
111 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: 111 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA:
112 Java_WebsitePreferenceBridge_insertCameraInfoIntoList( 112 Java_WebsitePreferenceBridge_insertCameraInfoIntoList(
113 env, list, jorigin.obj(), jembedder.obj()); 113 env, list, jorigin.obj(), jembedder.obj());
114 break; 114 break;
115 case CONTENT_SETTINGS_TYPE_GEOLOCATION: 115 case CONTENT_SETTINGS_TYPE_GEOLOCATION:
116 Java_WebsitePreferenceBridge_insertGeolocationInfoIntoList( 116 Java_WebsitePreferenceBridge_insertGeolocationInfoIntoList(
117 env, list, jorigin.obj(), jembedder.obj()); 117 env, list, jorigin.obj(), jembedder.obj());
118 break; 118 break;
119 case CONTENT_SETTINGS_TYPE_KEYGEN:
120 Java_WebsitePreferenceBridge_insertKeygenInfoIntoList(
121 env, list, jorigin.obj(), jembedder.obj());
122 break;
119 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: 123 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
120 Java_WebsitePreferenceBridge_insertMidiInfoIntoList( 124 Java_WebsitePreferenceBridge_insertMidiInfoIntoList(
121 env, list, jorigin.obj(), jembedder.obj()); 125 env, list, jorigin.obj(), jembedder.obj());
122 break; 126 break;
123 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: 127 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
124 Java_WebsitePreferenceBridge_insertProtectedMediaIdentifierInfoIntoList( 128 Java_WebsitePreferenceBridge_insertProtectedMediaIdentifierInfoIntoList(
125 env, list, jorigin.obj(), jembedder.obj()); 129 env, list, jorigin.obj(), jembedder.obj());
126 break; 130 break;
127 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: 131 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
128 Java_WebsitePreferenceBridge_insertPushNotificationIntoList( 132 Java_WebsitePreferenceBridge_insertPushNotificationIntoList(
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 const JavaParamRef<jstring>& origin, 221 const JavaParamRef<jstring>& origin,
218 const JavaParamRef<jstring>& embedder, 222 const JavaParamRef<jstring>& embedder,
219 jint value, 223 jint value,
220 jboolean is_incognito) { 224 jboolean is_incognito) {
221 GURL embedder_url(ConvertJavaStringToUTF8(env, embedder)); 225 GURL embedder_url(ConvertJavaStringToUTF8(env, embedder));
222 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_GEOLOCATION, origin, 226 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_GEOLOCATION, origin,
223 ContentSettingsPattern::FromURLNoWildcard(embedder_url), 227 ContentSettingsPattern::FromURLNoWildcard(embedder_url),
224 (ContentSetting) value, is_incognito); 228 (ContentSetting) value, is_incognito);
225 } 229 }
226 230
231 static void GetKeygenOrigins(JNIEnv* env,
232 const JavaParamRef<jclass>& clazz,
233 const JavaParamRef<jobject>& list) {
234 GetOrigins(env, CONTENT_SETTINGS_TYPE_KEYGEN, list, false);
235 }
236
237 static jint GetKeygenSettingForOrigin(JNIEnv* env,
238 const JavaParamRef<jclass>& clazz,
239 const JavaParamRef<jstring>& origin,
240 const JavaParamRef<jstring>& embedder,
241 jboolean is_incognito) {
242 return GetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_KEYGEN, origin,
243 embedder, is_incognito);
244 }
245
246 static void SetKeygenSettingForOrigin(JNIEnv* env,
247 const JavaParamRef<jclass>& clazz,
248 const JavaParamRef<jstring>& origin,
249 const JavaParamRef<jstring>& embedder,
250 jint value,
251 jboolean is_incognito) {
252 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_KEYGEN, origin,
253 ContentSettingsPattern::Wildcard(),
254 (ContentSetting) value, is_incognito);
255 }
256
227 static void GetMidiOrigins(JNIEnv* env, 257 static void GetMidiOrigins(JNIEnv* env,
228 const JavaParamRef<jclass>& clazz, 258 const JavaParamRef<jclass>& clazz,
229 const JavaParamRef<jobject>& list) { 259 const JavaParamRef<jobject>& list) {
230 GetOrigins(env, CONTENT_SETTINGS_TYPE_MIDI_SYSEX, list, false); 260 GetOrigins(env, CONTENT_SETTINGS_TYPE_MIDI_SYSEX, list, false);
231 } 261 }
232 262
233 static jint GetMidiSettingForOrigin(JNIEnv* env, 263 static jint GetMidiSettingForOrigin(JNIEnv* env,
234 const JavaParamRef<jclass>& clazz, 264 const JavaParamRef<jclass>& clazz,
235 const JavaParamRef<jstring>& origin, 265 const JavaParamRef<jstring>& origin,
236 const JavaParamRef<jstring>& embedder, 266 const JavaParamRef<jstring>& embedder,
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
794 GURL url(ConvertJavaStringToUTF8(env, jorigin)); 824 GURL url(ConvertJavaStringToUTF8(env, jorigin));
795 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( 825 scoped_refptr<SiteDataDeleteHelper> site_data_deleter(
796 new SiteDataDeleteHelper(profile, url)); 826 new SiteDataDeleteHelper(profile, url));
797 site_data_deleter->Run(); 827 site_data_deleter->Run();
798 } 828 }
799 829
800 // Register native methods 830 // Register native methods
801 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { 831 bool RegisterWebsitePreferenceBridge(JNIEnv* env) {
802 return RegisterNativesImpl(env); 832 return RegisterNativesImpl(env);
803 } 833 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698