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

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

Issue 2458453002: [sensors] Add Permission guard to the generic sensor apis.
Patch Set: rebase + blink reformat Created 3 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 | « chrome/browser/DEPS ('k') | chrome/browser/android/resource_id.h » ('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 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 <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 static void SetMidiSettingForOrigin(JNIEnv* env, 271 static void SetMidiSettingForOrigin(JNIEnv* env,
272 const JavaParamRef<jclass>& clazz, 272 const JavaParamRef<jclass>& clazz,
273 const JavaParamRef<jstring>& origin, 273 const JavaParamRef<jstring>& origin,
274 const JavaParamRef<jstring>& embedder, 274 const JavaParamRef<jstring>& embedder,
275 jint value, 275 jint value,
276 jboolean is_incognito) { 276 jboolean is_incognito) {
277 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_MIDI_SYSEX, origin, embedder, 277 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_MIDI_SYSEX, origin, embedder,
278 static_cast<ContentSetting>(value), is_incognito); 278 static_cast<ContentSetting>(value), is_incognito);
279 } 279 }
280 280
281 static void GetSensorOrigins(JNIEnv* env,
282 const JavaParamRef<jclass>& clazz,
283 const JavaParamRef<jobject>& list) {
284 GetOrigins(env, CONTENT_SETTINGS_TYPE_SENSORS,
285 &Java_WebsitePreferenceBridge_insertSensorInfoIntoList, list,
286 false);
287 }
288
289 static jint GetSensorSettingForOrigin(JNIEnv* env,
290 const JavaParamRef<jclass>& clazz,
291 const JavaParamRef<jstring>& origin,
292 const JavaParamRef<jstring>& embedder,
293 jboolean is_incognito) {
294 return GetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_SENSORS, origin,
295 embedder, is_incognito);
296 }
297
298 static void SetSensorSettingForOrigin(JNIEnv* env,
299 const JavaParamRef<jclass>& clazz,
300 const JavaParamRef<jstring>& origin,
301 const JavaParamRef<jstring>& embedder,
302 jint value,
303 jboolean is_incognito) {
304 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_SENSORS, origin, embedder,
305 static_cast<ContentSetting>(value), is_incognito);
306 }
307
281 static void GetProtectedMediaIdentifierOrigins( 308 static void GetProtectedMediaIdentifierOrigins(
282 JNIEnv* env, 309 JNIEnv* env,
283 const JavaParamRef<jclass>& clazz, 310 const JavaParamRef<jclass>& clazz,
284 const JavaParamRef<jobject>& list) { 311 const JavaParamRef<jobject>& list) {
285 GetOrigins( 312 GetOrigins(
286 env, CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER, 313 env, CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER,
287 &Java_WebsitePreferenceBridge_insertProtectedMediaIdentifierInfoIntoList, 314 &Java_WebsitePreferenceBridge_insertProtectedMediaIdentifierInfoIntoList,
288 list, false); 315 list, false);
289 } 316 }
290 317
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 SearchGeolocationService* search_helper = 847 SearchGeolocationService* search_helper =
821 SearchGeolocationService::Factory::GetForBrowserContext( 848 SearchGeolocationService::Factory::GetForBrowserContext(
822 GetActiveUserProfile(false /* is_incognito */)); 849 GetActiveUserProfile(false /* is_incognito */));
823 return search_helper->SetDSEGeolocationSetting(setting); 850 return search_helper->SetDSEGeolocationSetting(setting);
824 } 851 }
825 852
826 // Register native methods 853 // Register native methods
827 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { 854 bool RegisterWebsitePreferenceBridge(JNIEnv* env) {
828 return RegisterNativesImpl(env); 855 return RegisterNativesImpl(env);
829 } 856 }
OLDNEW
« no previous file with comments | « chrome/browser/DEPS ('k') | chrome/browser/android/resource_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698