Chromium Code Reviews| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 308 &Java_WebsitePreferenceBridge_insertNotificationIntoList, list, | 308 &Java_WebsitePreferenceBridge_insertNotificationIntoList, list, |
| 309 false); | 309 false); |
| 310 } | 310 } |
| 311 | 311 |
| 312 static jint GetNotificationSettingForOrigin( | 312 static jint GetNotificationSettingForOrigin( |
| 313 JNIEnv* env, | 313 JNIEnv* env, |
| 314 const JavaParamRef<jclass>& clazz, | 314 const JavaParamRef<jclass>& clazz, |
| 315 const JavaParamRef<jstring>& origin, | 315 const JavaParamRef<jstring>& origin, |
| 316 const JavaParamRef<jstring>& embedder, | 316 const JavaParamRef<jstring>& embedder, |
| 317 jboolean is_incognito) { | 317 jboolean is_incognito) { |
| 318 return DesktopNotificationProfileUtil::GetContentSetting( | 318 return GetSettingForOrigin(env, CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
| 319 GetActiveUserProfile(is_incognito), | 319 origin, origin, is_incognito); |
|
Bernhard Bauer
2016/06/02 11:19:01
Is it on purpose that we ignore the embedder and u
Michael van Ouwerkerk
2016/06/02 12:03:01
Yes, that's on purpose: https://codereview.chromiu
lshang
2016/06/02 12:05:25
I use origins for both params here mainly because
Bernhard Bauer
2016/06/02 12:23:04
Why don't we get rid of the parameter then?
| |
| 320 GURL(ConvertJavaStringToUTF8(env, origin))); | |
| 321 } | 320 } |
| 322 | 321 |
| 323 static void SetNotificationSettingForOrigin( | 322 static void SetNotificationSettingForOrigin( |
| 324 JNIEnv* env, | 323 JNIEnv* env, |
| 325 const JavaParamRef<jclass>& clazz, | 324 const JavaParamRef<jclass>& clazz, |
| 326 const JavaParamRef<jstring>& origin, | 325 const JavaParamRef<jstring>& origin, |
| 327 const JavaParamRef<jstring>& embedder, | 326 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 |
| (...skipping 360 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 |