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

Unified Diff: chrome/browser/push_messaging/push_messaging_service_impl.h

Issue 1062913005: Push API: Deflake PushEventEnforcesUserVisibleNotification (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bindcurrent
Patch Set: Created 5 years, 8 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/push_messaging/push_messaging_service_impl.h
diff --git a/chrome/browser/push_messaging/push_messaging_service_impl.h b/chrome/browser/push_messaging/push_messaging_service_impl.h
index 01de3982db2d46452e2fd023b321e285aa911c5a..2a4ed65949c8c60b9d7a6d8a28ce525a790e448e 100644
--- a/chrome/browser/push_messaging/push_messaging_service_impl.h
+++ b/chrome/browser/push_messaging/push_messaging_service_impl.h
@@ -90,6 +90,7 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
// KeyedService implementation.
void Shutdown() override;
+ void SetMessageCallbackForTesting(const base::Closure& callback);
void SetContentSettingChangedCallbackForTesting(
const base::Closure& callback);
@@ -104,6 +105,7 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
const GURL& requesting_origin,
int64 service_worker_registration_id,
const gcm::GCMClient::IncomingMessage& message,
+ const base::Closure& message_handled_closure,
content::PushDeliveryStatus status);
// Developers are required to display a Web Notification in response to an
@@ -111,12 +113,14 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
// happened in the background. When they forget to do so, display a default
// notification on their behalf.
void RequireUserVisibleUX(const GURL& requesting_origin,
- int64 service_worker_registration_id);
+ int64 service_worker_registration_id,
+ const base::Closure& message_handled_closure);
void DidGetNotificationsShown(
const GURL& requesting_origin,
int64 service_worker_registration_id,
bool notification_shown,
bool notification_needed,
+ const base::Closure& message_handled_closure,
const std::string& data,
bool success,
bool not_found);
@@ -169,6 +173,7 @@ class PushMessagingServiceImpl : public content::PushMessagingService,
int push_registration_count_;
int pending_push_registration_count_;
+ base::Closure message_callback_for_testing_;
base::Closure content_setting_changed_callback_for_testing_;
base::WeakPtrFactory<PushMessagingServiceImpl> weak_factory_;

Powered by Google App Engine
This is Rietveld 408576698