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

Unified Diff: content/renderer/push_messaging_dispatcher.h

Issue 661463002: Implement PushManager#hasPermission (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support all three possible states of the permission Created 6 years, 2 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: content/renderer/push_messaging_dispatcher.h
diff --git a/content/renderer/push_messaging_dispatcher.h b/content/renderer/push_messaging_dispatcher.h
index e0c5c99136cdc1edc797354f1e0b0247b52a1252..de4bc605c60bdddfbd9da94b3af6f0ca135d1d7b 100644
--- a/content/renderer/push_messaging_dispatcher.h
+++ b/content/renderer/push_messaging_dispatcher.h
@@ -11,6 +11,7 @@
#include "content/public/common/push_messaging_status.h"
#include "content/public/renderer/render_frame_observer.h"
#include "third_party/WebKit/public/platform/WebPushClient.h"
+#include "third_party/WebKit/public/platform/WebPushPermissionCallback.h"
class GURL;
@@ -19,6 +20,7 @@ class Message;
} // namespace IPC
namespace blink {
+class WebPushPermissionCallback;
class WebServiceWorkerProvider;
class WebString;
} // namespace blink
@@ -43,19 +45,31 @@ class PushMessagingDispatcher : public RenderFrameObserver,
blink::WebPushRegistrationCallbacks* callbacks,
blink::WebServiceWorkerProvider* service_worker_provider);
+
mlamouri (slow - plz ping) 2014/10/16 09:04:57 nit: no need for that new line.
Miguel Garcia 2014/10/16 13:50:26 Done.
void DoRegister(const std::string& sender_id,
blink::WebPushRegistrationCallbacks* callbacks,
blink::WebServiceWorkerProvider* service_worker_provider,
const Manifest& manifest);
+ virtual void permissionStatus(
mlamouri (slow - plz ping) 2014/10/16 09:04:57 nit: uppercase 'P' for PermissionStatus().
Miguel Garcia 2014/10/16 13:50:26 It seems we are using lower case for the virtual m
mlamouri (slow - plz ping) 2014/10/17 09:30:56 registerPushMessaging() is an override from WebPus
+ blink::WebPushPermissionCallback* callback,
+ blink::WebServiceWorkerProvider* service_worker_provider);
+
void OnRegisterSuccess(int32 callbacks_id,
const GURL& endpoint,
const std::string& registration_id);
void OnRegisterError(int32 callbacks_id, PushMessagingStatus status);
+ void OnPermissionStatus(int32 callback_id,
+ blink::WebPushPermissionCallback::PushPermissionStatus);
mlamouri (slow - plz ping) 2014/10/16 09:04:57 nit: indent
Miguel Garcia 2014/10/16 13:50:26 Done.
+
+
IDMap<blink::WebPushRegistrationCallbacks, IDMapOwnPointer>
registration_callbacks_;
+ IDMap<blink::WebPushPermissionCallback, IDMapOwnPointer>
+ permission_check_callbacks_;
+
DISALLOW_COPY_AND_ASSIGN(PushMessagingDispatcher);
};

Powered by Google App Engine
This is Rietveld 408576698