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 "base/android/callback_android.h" | 7 #include "base/android/callback_android.h" |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 jboolean is_incognito) { | 317 jboolean is_incognito) { |
318 return DesktopNotificationProfileUtil::GetContentSetting( | 318 return DesktopNotificationProfileUtil::GetContentSetting( |
319 GetActiveUserProfile(is_incognito), | 319 GetActiveUserProfile(is_incognito), |
320 GURL(ConvertJavaStringToUTF8(env, origin))); | 320 GURL(ConvertJavaStringToUTF8(env, origin))); |
321 } | 321 } |
322 | 322 |
323 static void SetNotificationSettingForOrigin( | 323 static void SetNotificationSettingForOrigin( |
324 JNIEnv* env, | 324 JNIEnv* env, |
325 const JavaParamRef<jclass>& clazz, | 325 const JavaParamRef<jclass>& clazz, |
326 const JavaParamRef<jstring>& origin, | 326 const JavaParamRef<jstring>& origin, |
327 const JavaParamRef<jstring>& embedder, | |
328 jint value, | 327 jint value, |
329 jboolean is_incognito) { | 328 jboolean is_incognito) { |
330 // Note: Web Notification permission behaves differently from all other | 329 // Note: Web Notification permission behaves differently from all other |
331 // permission types. See https://crbug.com/416894. | 330 // permission types. See https://crbug.com/416894. |
332 Profile* profile = GetActiveUserProfile(is_incognito); | 331 Profile* profile = GetActiveUserProfile(is_incognito); |
333 GURL url = GURL(ConvertJavaStringToUTF8(env, origin)); | 332 GURL url = GURL(ConvertJavaStringToUTF8(env, origin)); |
334 ContentSetting setting = static_cast<ContentSetting>(value); | 333 ContentSetting setting = static_cast<ContentSetting>(value); |
335 switch (setting) { | 334 switch (setting) { |
336 case CONTENT_SETTING_DEFAULT: | 335 case CONTENT_SETTING_DEFAULT: |
337 DesktopNotificationProfileUtil::ClearSetting(profile, url); | 336 DesktopNotificationProfileUtil::ClearSetting(profile, url); |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 GURL url(ConvertJavaStringToUTF8(env, jorigin)); | 690 GURL url(ConvertJavaStringToUTF8(env, jorigin)); |
692 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( | 691 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( |
693 new SiteDataDeleteHelper(profile, url)); | 692 new SiteDataDeleteHelper(profile, url)); |
694 site_data_deleter->Run(); | 693 site_data_deleter->Run(); |
695 } | 694 } |
696 | 695 |
697 // Register native methods | 696 // Register native methods |
698 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { | 697 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { |
699 return RegisterNativesImpl(env); | 698 return RegisterNativesImpl(env); |
700 } | 699 } |
OLD | NEW |