Index: public/platform/WebPushPermissionCallback.h |
diff --git a/public/platform/WebPushPermissionCallback.h b/public/platform/WebPushPermissionCallback.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0bcde5a8bb21347f000629c892f538eb043c9bb6 |
--- /dev/null |
+++ b/public/platform/WebPushPermissionCallback.h |
@@ -0,0 +1,34 @@ |
+// 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 |
+ |
+// 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 { |
Peter Beverloo
2014/10/20 12:23:49
Instead of re-inventing the callback API, can you
Miguel Garcia
2014/10/22 12:58:44
We discussed this at length with the main reviewer
|
+ public: |
Michael van Ouwerkerk
2014/10/20 11:25:43
All of this indent -4. Just run "git cl format"
Miguel Garcia
2014/10/22 12:58:44
Done.
Miguel Garcia
2014/10/22 12:58:44
Done.
|
+ |
+ enum PushPermissionStatus { |
+ PushPermissionGranted = 0, |
Michael van Ouwerkerk
2014/10/20 11:25:43
Enum members must start with the full enum name.
Miguel Garcia
2014/10/22 12:58:44
Done.
|
+ PushPermissionDenied, |
+ PushPermissionDefault, |
+ |
+ // Used for IPC message range checks. |
+ PushPermissionTypeLast = PushPermissionDefault |
+ }; |
+ |
+ virtual ~WebPushPermissionCallback() { } |
+ |
+ // Called if the embedder is able to check the status of the push permission. |
+ virtual void onSuccess(PushPermissionStatus) = 0; |
+ |
+ // Called if for some reason the status of the push permission cannot be checked. |
+ virtual void onError() = 0; |
+}; |
+ |
+} // namespace blink |
Peter Beverloo
2014/10/20 12:23:49
nit: new line after this one.
Miguel Garcia
2014/10/22 12:58:44
Done.
|
+#endif // WebPushPermissionCallback_h |