| 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 NotificationPermissionClient_h | 5 #ifndef NotificationPermissionClient_h |
| 6 #define NotificationPermissionClient_h | 6 #define NotificationPermissionClient_h |
| 7 | 7 |
| 8 #include "modules/notifications/NotificationPermissionCallback.h" | 8 #include "modules/notifications/NotificationPermissionCallback.h" |
| 9 #include "platform/Supplementable.h" | 9 #include "platform/Supplementable.h" |
| 10 #include "wtf/PassOwnPtr.h" | 10 #include "wtf/PassOwnPtr.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class ExecutionContext; | 14 class ExecutionContext; |
| 15 class LocalFrame; | 15 class LocalFrame; |
| 16 | 16 |
| 17 class NotificationPermissionClient : public WillBeHeapSupplement<LocalFrame> { | 17 class NotificationPermissionClient : public WillBeHeapSupplement<LocalFrame> { |
| 18 public: | 18 public: |
| 19 virtual ~NotificationPermissionClient() { } | 19 virtual ~NotificationPermissionClient() { } |
| 20 | 20 |
| 21 // Requests user permission to show platform notifications from the origin | 21 // Requests user permission to show platform notifications from the origin |
| 22 // of the current frame. The provided callback will be ran when the user | 22 // of the current frame. The provided callback will be ran when the user |
| 23 // has made a decision. | 23 // has made a decision. |
| 24 virtual void requestPermission(ExecutionContext*, PassOwnPtrWillBeRawPtr<Not
ificationPermissionCallback>) = 0; | 24 virtual void requestPermission(ExecutionContext*, NotificationPermissionCall
back*) = 0; |
| 25 | 25 |
| 26 // WillBeHeapSupplement requirements. | 26 // WillBeHeapSupplement requirements. |
| 27 static const char* supplementName(); | 27 static const char* supplementName(); |
| 28 static NotificationPermissionClient* from(ExecutionContext*); | 28 static NotificationPermissionClient* from(ExecutionContext*); |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 void provideNotificationPermissionClientTo(LocalFrame&, PassOwnPtrWillBeRawPtr<N
otificationPermissionClient>); | 31 void provideNotificationPermissionClientTo(LocalFrame&, PassOwnPtrWillBeRawPtr<N
otificationPermissionClient>); |
| 32 | 32 |
| 33 } // namespace blink | 33 } // namespace blink |
| 34 | 34 |
| 35 #endif // NotificationPermissionClient_h | 35 #endif // NotificationPermissionClient_h |
| OLD | NEW |