Chromium Code Reviews| Index: Source/modules/push_messaging/PushPermissionCallback.h |
| diff --git a/Source/modules/push_messaging/PushPermissionCallback.h b/Source/modules/push_messaging/PushPermissionCallback.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d21168f68b132dcac24466713efb938a976c7fc4 |
| --- /dev/null |
| +++ b/Source/modules/push_messaging/PushPermissionCallback.h |
| @@ -0,0 +1,43 @@ |
| +// 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 PushPermissionCallback_h |
| +#define PushPermissionCallback_h |
| + |
| +#include "public/platform/WebPushPermissionCallback.h" |
| +#include "wtf/Noncopyable.h" |
| +#include "wtf/PassRefPtr.h" |
| +#include "wtf/RefPtr.h" |
| + |
| +namespace WTF { |
| +class String; |
| +} |
| + |
| +namespace blink { |
| + |
| +class ScriptPromiseResolver; |
| + |
| +// Will resolve the underlying promise depending on the permission |
| +// passed to the callback. |
| +class PushPermissionCallback final : public WebPushPermissionCallback { |
| + WTF_MAKE_NONCOPYABLE(PushPermissionCallback); |
| + |
| + public: |
|
mlamouri (slow - plz ping)
2014/10/17 09:22:01
coding style:
- there is a useless empty line befo
Miguel Garcia
2014/10/20 09:58:10
Done.
|
| + PushPermissionCallback(PassRefPtr<ScriptPromiseResolver>); |
| + virtual ~PushPermissionCallback(); |
| + |
| + // Called if the embedder is able to check the status of the push permission. |
|
mlamouri (slow - plz ping)
2014/10/17 09:22:01
nit: I would put those comments in WebPushPermissi
Miguel Garcia
2014/10/20 09:58:10
Done.
|
| + virtual void onSuccess(PushPermissionStatus) override; |
| + |
| + // Called if for some reason the status of the push permission cannot be checked. |
| + virtual void onError() override; |
| + |
| + private: |
| + static const WTF::String& permissionString(PushPermissionStatus); |
|
mlamouri (slow - plz ping)
2014/10/17 09:22:01
Could you move that in an anonymous namespace in t
|
| + RefPtr<ScriptPromiseResolver> m_resolver; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // PushPermissionCallback_h |