| 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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 profile, origin_url, embedder_url, content_type, | 167 profile, origin_url, embedder_url, content_type, |
| 168 PermissionSourceUI::SITE_SETTINGS); | 168 PermissionSourceUI::SITE_SETTINGS); |
| 169 HostContentSettingsMapFactory::GetForProfile(profile) | 169 HostContentSettingsMapFactory::GetForProfile(profile) |
| 170 ->SetContentSettingDefaultScope(origin_url, embedder_url, content_type, | 170 ->SetContentSettingDefaultScope(origin_url, embedder_url, content_type, |
| 171 std::string(), setting); | 171 std::string(), setting); |
| 172 WebSiteSettingsUmaUtil::LogPermissionChange(content_type, setting); | 172 WebSiteSettingsUmaUtil::LogPermissionChange(content_type, setting); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // anonymous namespace | 175 } // anonymous namespace |
| 176 | 176 |
| 177 static void GetFullscreenOrigins(JNIEnv* env, | |
| 178 const JavaParamRef<jclass>& clazz, | |
| 179 const JavaParamRef<jobject>& list, | |
| 180 jboolean managedOnly) { | |
| 181 GetOrigins(env, CONTENT_SETTINGS_TYPE_FULLSCREEN, | |
| 182 &Java_WebsitePreferenceBridge_insertFullscreenInfoIntoList, list, | |
| 183 managedOnly); | |
| 184 } | |
| 185 | |
| 186 static jint GetFullscreenSettingForOrigin(JNIEnv* env, | |
| 187 const JavaParamRef<jclass>& clazz, | |
| 188 const JavaParamRef<jstring>& origin, | |
| 189 const JavaParamRef<jstring>& embedder, | |
| 190 jboolean is_incognito) { | |
| 191 return GetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_FULLSCREEN, origin, | |
| 192 embedder, is_incognito); | |
| 193 } | |
| 194 | |
| 195 static void SetFullscreenSettingForOrigin(JNIEnv* env, | |
| 196 const JavaParamRef<jclass>& clazz, | |
| 197 const JavaParamRef<jstring>& origin, | |
| 198 const JavaParamRef<jstring>& embedder, | |
| 199 jint value, | |
| 200 jboolean is_incognito) { | |
| 201 SetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_FULLSCREEN, origin, embedder, | |
| 202 static_cast<ContentSetting>(value), is_incognito); | |
| 203 } | |
| 204 | |
| 205 static void GetGeolocationOrigins(JNIEnv* env, | 177 static void GetGeolocationOrigins(JNIEnv* env, |
| 206 const JavaParamRef<jclass>& clazz, | 178 const JavaParamRef<jclass>& clazz, |
| 207 const JavaParamRef<jobject>& list, | 179 const JavaParamRef<jobject>& list, |
| 208 jboolean managedOnly) { | 180 jboolean managedOnly) { |
| 209 GetOrigins(env, CONTENT_SETTINGS_TYPE_GEOLOCATION, | 181 GetOrigins(env, CONTENT_SETTINGS_TYPE_GEOLOCATION, |
| 210 &Java_WebsitePreferenceBridge_insertGeolocationInfoIntoList, list, | 182 &Java_WebsitePreferenceBridge_insertGeolocationInfoIntoList, list, |
| 211 managedOnly); | 183 managedOnly); |
| 212 } | 184 } |
| 213 | 185 |
| 214 static jint GetGeolocationSettingForOrigin( | 186 static jint GetGeolocationSettingForOrigin( |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 793 GURL url(ConvertJavaStringToUTF8(env, jorigin)); | 765 GURL url(ConvertJavaStringToUTF8(env, jorigin)); |
| 794 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( | 766 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( |
| 795 new SiteDataDeleteHelper(profile, url)); | 767 new SiteDataDeleteHelper(profile, url)); |
| 796 site_data_deleter->Run(); | 768 site_data_deleter->Run(); |
| 797 } | 769 } |
| 798 | 770 |
| 799 // Register native methods | 771 // Register native methods |
| 800 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { | 772 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { |
| 801 return RegisterNativesImpl(env); | 773 return RegisterNativesImpl(env); |
| 802 } | 774 } |
| OLD | NEW |