OLD | NEW |
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 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 816 |
817 static void SetDSEGeolocationSetting(JNIEnv* env, | 817 static void SetDSEGeolocationSetting(JNIEnv* env, |
818 const JavaParamRef<jclass>& clazz, | 818 const JavaParamRef<jclass>& clazz, |
819 jboolean setting) { | 819 jboolean setting) { |
820 SearchGeolocationService* search_helper = | 820 SearchGeolocationService* search_helper = |
821 SearchGeolocationService::Factory::GetForBrowserContext( | 821 SearchGeolocationService::Factory::GetForBrowserContext( |
822 GetActiveUserProfile(false /* is_incognito */)); | 822 GetActiveUserProfile(false /* is_incognito */)); |
823 return search_helper->SetDSEGeolocationSetting(setting); | 823 return search_helper->SetDSEGeolocationSetting(setting); |
824 } | 824 } |
825 | 825 |
| 826 static jboolean GetSubresourceFilterActivated( |
| 827 JNIEnv* env, |
| 828 const JavaParamRef<jclass>& clazz, |
| 829 const JavaParamRef<jstring>& jorigin) { |
| 830 GURL url(ConvertJavaStringToUTF8(env, jorigin)); |
| 831 return !!GetHostContentSettingsMap(false)->GetWebsiteSetting( |
| 832 url, GURL(), CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER_DATA, std::string(), |
| 833 nullptr); |
| 834 } |
| 835 |
826 // Register native methods | 836 // Register native methods |
827 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { | 837 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { |
828 return RegisterNativesImpl(env); | 838 return RegisterNativesImpl(env); |
829 } | 839 } |
OLD | NEW |