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

Unified Diff: chrome/browser/notifications/notification_ui_manager_android.cc

Issue 942103003: Handle notification preferences intent from gear icon. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass tag. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/notification_ui_manager_android.cc
diff --git a/chrome/browser/notifications/notification_ui_manager_android.cc b/chrome/browser/notifications/notification_ui_manager_android.cc
index 1cf6a7454fd72b0fefdac35a86f20f954ccc7d70..848fe9672415a00f5fd0fecf47524293bf3dc602 100644
--- a/chrome/browser/notifications/notification_ui_manager_android.cc
+++ b/chrome/browser/notifications/notification_ui_manager_android.cc
@@ -231,6 +231,8 @@ void NotificationUIManagerAndroid::Add(const Notification& notification,
JNIEnv* env = AttachCurrentThread();
+ ScopedJavaLocalRef<jstring> tag = ConvertUTF16ToJavaString(
+ env, profile_notification->notification().replace_id());
ScopedJavaLocalRef<jstring> id = ConvertUTF8ToJavaString(
env, profile_notification->notification().id());
ScopedJavaLocalRef<jstring> title = ConvertUTF16ToJavaString(
@@ -267,8 +269,8 @@ void NotificationUIManagerAndroid::Add(const Notification& notification,
}
int platform_id = Java_NotificationUIManager_displayNotification(
- env, java_object_.obj(), id.obj(), title.obj(), body.obj(), icon.obj(),
- origin.obj(), notification_data.obj());
+ env, java_object_.obj(), tag.obj(), id.obj(), title.obj(), body.obj(),
+ icon.obj(), origin.obj(), notification_data.obj());
std::string notification_id = profile_notification->notification().id();
platform_notifications_[notification_id] = platform_id;
@@ -413,9 +415,20 @@ void NotificationUIManagerAndroid::PlatformCloseNotification(
int platform_id = iterator->second;
platform_notifications_.erase(notification_id);
- Java_NotificationUIManager_closeNotification(AttachCurrentThread(),
- java_object_.obj(),
- platform_id);
+ ProfileNotification* profile_notification =
+ FindProfileNotification(notification_id);
+ if (!profile_notification)
+ return;
Peter Beverloo 2015/02/24 17:48:03 We don't add the notification to profile_notificat
Michael van Ouwerkerk 2015/02/25 18:12:45 Done.
+
+ JNIEnv* env = AttachCurrentThread();
+
+ ScopedJavaLocalRef<jstring> tag = ConvertUTF16ToJavaString(
+ env, profile_notification->notification().replace_id());
+ ScopedJavaLocalRef<jstring> origin = ConvertUTF8ToJavaString(
+ env, profile_notification->notification().origin_url().spec());
+
+ Java_NotificationUIManager_closeNotification(
+ env, java_object_.obj(), tag.obj(), platform_id, origin.obj());
}
void NotificationUIManagerAndroid::AddProfileNotification(

Powered by Google App Engine
This is Rietveld 408576698