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

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

Issue 2974573002: Refactor WebApkServiceConnectionManager. (Closed)
Patch Set: Check bindService()'s return value. 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..21825913a070434256b7b7a09ef9ffbbb4e31c38 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(
pkotwicz 2017/07/14 23:20:04 The order of the functions in the .h file should m
Xi Han 2017/07/17 20:45:31 The following four functions are overriding functi
pkotwicz 2017/07/18 17:30:46 You can change the order of the functions in the .
Xi Han 2017/07/18 22:36:51 In .cc file, the OnQueryWebApkPackage() is called
pkotwicz 2017/07/19 16:09:13 From the Chromium style guide: "Function declarati
Xi Han 2017/07/21 20:36:33 Done.
+ 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,12 @@ class NotificationPlatformBridgeAndroid : public NotificationPlatformBridge {
std::string webapk_package;
};
+ void OnQueryWebApkPackageInternal(const std::string& notification_id,
+ const std::string& profile_id,
+ bool incognito,
+ const Notification& notification,
+ const std::string& webapk_package);
pkotwicz 2017/07/18 17:30:46 This function does not seem to be implemented in t
Xi Han 2017/07/18 22:36:51 I renamed it to DisplayInternal() in patch set 9,
+
// 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 +119,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