OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PushPermissionCallback_h | |
6 #define PushPermissionCallback_h | |
7 | |
8 #include "public/platform/WebPushPermissionCallback.h" | |
9 #include "wtf/Noncopyable.h" | |
10 #include "wtf/PassRefPtr.h" | |
11 #include "wtf/RefPtr.h" | |
12 | |
13 namespace WTF { | |
14 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
| |
15 } | |
16 | |
17 namespace blink { | |
18 | |
19 class ScriptPromiseResolver; | |
20 | |
21 // Will resolve the underlying promise depending on the permission | |
22 // 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
| |
23 class PushPermissionCallback final : public WebPushPermissionCallback { | |
24 WTF_MAKE_NONCOPYABLE(PushPermissionCallback); | |
25 public: | |
26 PushPermissionCallback(PassRefPtr<ScriptPromiseResolver>); | |
Michael van Ouwerkerk
2014/10/20 11:25:42
explicit
Miguel Garcia
2014/10/22 12:58:44
Done.
| |
27 virtual ~PushPermissionCallback(); | |
28 | |
29 virtual void onSuccess(PushPermissionStatus) override; | |
30 | |
31 // Called if for some reason the status of the push permission cannot be che cked. | |
32 virtual void onError() override; | |
33 | |
34 private: | |
35 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
| |
36 RefPtr<ScriptPromiseResolver> m_resolver; | |
37 }; | |
38 | |
39 } // namespace blink | |
40 | |
41 #endif // PushPermissionCallback_h | |
OLD | NEW |