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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_android.h

Issue 2974573002: Refactor WebApkServiceConnectionManager. (Closed)
Patch Set: pkotwicz@‘s comments. Created 3 years, 5 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_platform_bridge_android.h
diff --git a/chrome/browser/notifications/notification_platform_bridge_android.h b/chrome/browser/notifications/notification_platform_bridge_android.h
index 9b2af9ae127a4370a8c9cb89f597386daf500f29..2f0110e26dbdc14d39a1e2773882ee7cc0239741 100644
--- a/chrome/browser/notifications/notification_platform_bridge_android.h
+++ b/chrome/browser/notifications/notification_platform_bridge_android.h
@@ -13,6 +13,7 @@
#include "base/android/scoped_java_ref.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/notifications/displayed_notifications_dispatch_callback.h"
#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/notification_platform_bridge.h"
@@ -62,6 +63,13 @@ class NotificationPlatformBridgeAndroid : public NotificationPlatformBridge {
const base::android::JavaParamRef<jstring>& java_tag,
jboolean by_user);
+ // Called after querying the webapk package is done on Java side.
+ void OnQueryWebApkPackage(
+ JNIEnv* env,
+ const base::android::JavaParamRef<jobject>& java_object,
+ const base::android::JavaParamRef<jstring>& java_webapk_package,
+ const jlong jcallback_pointer);
+
// NotificationPlatformBridge implementation.
void Display(NotificationCommon::Type notification_type,
const std::string& notification_id,
@@ -97,6 +105,13 @@ class NotificationPlatformBridgeAndroid : public NotificationPlatformBridge {
std::string webapk_package;
};
+ // Display a notification.
+ void DisplayInternal(const std::string& notification_id,
+ const std::string& profile_id,
+ bool incognito,
+ const Notification& notification,
+ const std::string& webapk_package);
+
// Mapping of notification id to renegerated notification info.
// TODO(peter): Remove this map once notification delegate ids for Web
// notifications are created by the content/ layer.
@@ -105,6 +120,9 @@ class NotificationPlatformBridgeAndroid : public NotificationPlatformBridge {
base::android::ScopedJavaGlobalRef<jobject> java_object_;
+ // Factory for the creating refs in callbacks.
+ base::WeakPtrFactory<NotificationPlatformBridgeAndroid> weak_ptr_factory_;
+
DISALLOW_COPY_AND_ASSIGN(NotificationPlatformBridgeAndroid);
};

Powered by Google App Engine
This is Rietveld 408576698