OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PermissionCallbacks_h | 5 #ifndef PermissionCallbacks_h |
6 #define PermissionCallbacks_h | 6 #define PermissionCallbacks_h |
7 | 7 |
8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
9 #include "wtf/Functional.h" | 9 #include "wtf/Functional.h" |
10 #include "wtf/Noncopyable.h" | 10 #include "wtf/Noncopyable.h" |
11 #include "wtf/PassOwnPtr.h" | 11 #include "wtf/PassOwnPtr.h" |
12 | 12 |
13 namespace WebCore { | 13 namespace blink { |
14 | 14 |
15 class PLATFORM_EXPORT PermissionCallbacks { | 15 class PLATFORM_EXPORT PermissionCallbacks { |
16 WTF_MAKE_NONCOPYABLE(PermissionCallbacks); | 16 WTF_MAKE_NONCOPYABLE(PermissionCallbacks); |
17 public: | 17 public: |
18 static PassOwnPtr<PermissionCallbacks> create(const Closure& allowed, const
Closure& denied); | 18 static PassOwnPtr<PermissionCallbacks> create(const Closure& allowed, const
Closure& denied); |
19 virtual ~PermissionCallbacks() { } | 19 virtual ~PermissionCallbacks() { } |
20 | 20 |
21 void onAllowed() { m_allowed(); } | 21 void onAllowed() { m_allowed(); } |
22 void onDenied() { m_denied(); } | 22 void onDenied() { m_denied(); } |
23 | 23 |
24 private: | 24 private: |
25 PermissionCallbacks(const Closure& allowed, const Closure& denied); | 25 PermissionCallbacks(const Closure& allowed, const Closure& denied); |
26 | 26 |
27 Closure m_allowed; | 27 Closure m_allowed; |
28 Closure m_denied; | 28 Closure m_denied; |
29 }; | 29 }; |
30 | 30 |
31 } // namespace WebCore | 31 } // namespace blink |
32 | 32 |
33 #endif // PermissionCallbacks_h | 33 #endif // PermissionCallbacks_h |
OLD | NEW |