| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
| 14 #include "chrome/browser/notifications/notification_ui_manager.h" | 14 #include "chrome/browser/notifications/notification_ui_manager.h" |
| 15 | 15 |
| 16 class ProfileNotification; | 16 class ProfileNotification; |
| 17 | 17 |
| 18 // Implementation of the Notification UI Manager for Android, which defers to | 18 // Implementation of the Notification UI Manager for Android, which defers to |
| 19 // the Android framework for displaying notifications. | 19 // the Android framework for displaying notifications. |
| 20 class NotificationUIManagerAndroid : public NotificationUIManager { | 20 class NotificationUIManagerAndroid : public NotificationUIManager { |
| 21 public: | 21 public: |
| 22 NotificationUIManagerAndroid(); | 22 NotificationUIManagerAndroid(); |
| 23 ~NotificationUIManagerAndroid() override; | 23 ~NotificationUIManagerAndroid() override; |
| 24 | 24 |
| 25 // Called by the Java implementation when a notification has been clicked on. | 25 // Called by the Java implementation when a notification has been clicked on. |
| 26 bool OnNotificationClicked(JNIEnv* env, | 26 bool OnNotificationClicked(JNIEnv* env, |
| 27 jobject java_object, | 27 jobject java_object, |
| 28 jstring notification_id, | 28 jstring notification_id, |
| 29 jint platform_id, |
| 29 jbyteArray serialized_notification_data); | 30 jbyteArray serialized_notification_data); |
| 30 | 31 |
| 31 // Called by the Java implementation when a notification has been closed. | 32 // Called by the Java implementation when a notification has been closed. |
| 32 bool OnNotificationClosed(JNIEnv* env, | 33 bool OnNotificationClosed(JNIEnv* env, |
| 33 jobject java_object, | 34 jobject java_object, |
| 34 jstring notification_id); | 35 jstring notification_id); |
| 35 | 36 |
| 36 // NotificationUIManager implementation; | 37 // NotificationUIManager implementation; |
| 37 void Add(const Notification& notification, Profile* profile) override; | 38 void Add(const Notification& notification, Profile* profile) override; |
| 38 bool Update(const Notification& notification, | 39 bool Update(const Notification& notification, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 // Map from notification id to the associated platform Id. | 70 // Map from notification id to the associated platform Id. |
| 70 std::map<std::string, int> platform_notifications_; | 71 std::map<std::string, int> platform_notifications_; |
| 71 | 72 |
| 72 base::android::ScopedJavaGlobalRef<jobject> java_object_; | 73 base::android::ScopedJavaGlobalRef<jobject> java_object_; |
| 73 | 74 |
| 74 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); | 75 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerAndroid); |
| 75 }; | 76 }; |
| 76 | 77 |
| 77 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ | 78 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_ANDROID_H_ |
| OLD | NEW |