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

Unified Diff: public/platform/WebPushPermissionCallback.h

Issue 658723003: Blink implementation of PushManager#hasPermission() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Upgrade the push-messaging-api-surface-actual layout test to include hasPermission 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: public/platform/WebPushPermissionCallback.h
diff --git a/public/platform/WebPushPermissionCallback.h b/public/platform/WebPushPermissionCallback.h
new file mode 100644
index 0000000000000000000000000000000000000000..0f777854ce241c0c13d872b6bcfb5dc27810d7de
--- /dev/null
+++ b/public/platform/WebPushPermissionCallback.h
@@ -0,0 +1,26 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebPushPermissionCallback_h
+#define WebPushPermissionCallback_h
+
+#include "WebPushPermissionStatus.h"
+
+// Interface to be used by the embedder in order
+// to inform Blink when once the permission status for push has been checked.
+namespace blink {
+
+class WebPushPermissionCallback {
Mike West 2014/10/27 15:32:11 I don't think you need a whole class for this. Wha
Miguel Garcia 2014/10/28 11:07:00 Peter had the same comment, in the end we agreed t
Mike West 2014/10/28 11:23:35 Easier is relative. Introducing another callback t
+public:
+ virtual ~WebPushPermissionCallback() { }
+
+ // Called if the embedder is able to check the status of the push permission.
+ virtual void onSuccess(WebPushPermissionStatus) = 0;
+
+ // Called if for some reason the status of the push permission cannot be checked.
+ virtual void onError() = 0;
Mike West 2014/10/28 11:23:35 Are you sure you're not going to need to pass any
Miguel Garcia 2014/10/28 13:59:21 So right now the spec does not really pass any arg
+};
+
+} // namespace blink
+#endif // WebPushPermissionCallback_h

Powered by Google App Engine
This is Rietveld 408576698