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..4a17e0f4ff876d49b658112c2b3bfba2c520e098 |
| --- /dev/null |
| +++ b/Source/modules/push_messaging/PushPermissionCallback.h |
| @@ -0,0 +1,41 @@ |
| +// 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; |
|
Michael van Ouwerkerk
2014/10/20 11:25:42
Do you need to declare this? Noone else seems to.
Peter Beverloo
2014/10/20 12:23:49
I'd argue that IWYU is a good thing. Neither of th
Miguel Garcia
2014/10/22 12:58:44
Agreed, I think it is a bad idea to not include th
|
| +} |
| + |
| +namespace blink { |
| + |
| +class ScriptPromiseResolver; |
| + |
| +// Will resolve the underlying promise depending on the permission |
| +// passed to the callback. |
|
Peter Beverloo
2014/10/20 12:23:49
nit: no need for the linebreak.
Miguel Garcia
2014/10/22 12:58:44
Sigh
|
| +class PushPermissionCallback final : public WebPushPermissionCallback { |
| + WTF_MAKE_NONCOPYABLE(PushPermissionCallback); |
| +public: |
| + PushPermissionCallback(PassRefPtr<ScriptPromiseResolver>); |
|
Michael van Ouwerkerk
2014/10/20 11:25:42
explicit
Miguel Garcia
2014/10/22 12:58:44
Done.
|
| + virtual ~PushPermissionCallback(); |
| + |
| + 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); |
|
Michael van Ouwerkerk
2014/10/20 11:25:42
No need for WTF:: because we're using :-)
https://
Miguel Garcia
2014/10/22 12:58:44
Really? Is this in some guideline I'v missed? Othe
Michael van Ouwerkerk
2014/10/22 13:20:01
I linked to the using statement above, that's one
|
| + RefPtr<ScriptPromiseResolver> m_resolver; |
| +}; |
| + |
| +} // namespace blink |
| + |
| +#endif // PushPermissionCallback_h |