Let Notification Handlers report when event handling has completed
This will significantly help reduce flakiness in testing (one deflake
included in this CL), and is required for migrating Android's intent
handling system to the BackgroundTaskScheduler which needs to know when
handling of the event has finished.
In addition, a hack where the NativeNotificationDisplayService invoked
the Close() method on a notification's delegate in order to fire the
event for non-persistent Web Notifications has been removed. We can just
fire the event from the NotificationMessageFilter instead.
BUG=766854, 784951
Change-Id: I57d0a446e6c47281bb7b5e001c449fadddeba571
Reviewed-on: https://chromium-review.googlesource.com/779722
Commit-Queue: Peter Beverloo <[email protected]>
Reviewed-by: Anita Woodruff <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: David Trainor <[email protected]>
Cr-Commit-Position: refs/heads/master@{#518305}
diff --git a/chrome/browser/notifications/non_persistent_notification_handler.h b/chrome/browser/notifications/non_persistent_notification_handler.h
index a7f5534f..c46b7a63 100644
--- a/chrome/browser/notifications/non_persistent_notification_handler.h
+++ b/chrome/browser/notifications/non_persistent_notification_handler.h
@@ -19,14 +19,14 @@
void OnClose(Profile* profile,
const GURL& origin,
const std::string& notification_id,
- bool by_user) override;
-
+ bool by_user,
+ base::OnceClosure completed_closure) override;
void OnClick(Profile* profile,
const GURL& origin,
const std::string& notification_id,
const base::Optional<int>& action_index,
- const base::Optional<base::string16>& reply) override;
-
+ const base::Optional<base::string16>& reply,
+ base::OnceClosure completed_closure) override;
void OpenSettings(Profile* profile) override;
private: