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.
5 #ifndef NotificationPermissionClient_h
6 #define NotificationPermissionClient_h
8 #include "modules/notifications/NotificationPermissionCallback.h"
9 #include "platform/Supplementable.h"
10 #include "wtf/PassOwnPtr.h"
14 class ExecutionContext;
17 class NotificationPermissionClient : public WillBeHeapSupplement<LocalFrame> {
19 virtual ~NotificationPermissionClient() { }
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
23 // has made a decision.
24 virtual void requestPermission(ExecutionContext*, NotificationPermissionCallback*) = 0;
26 // WillBeHeapSupplement requirements.
27 static const char* supplementName();
28 static NotificationPermissionClient* from(ExecutionContext*);
31 void provideNotificationPermissionClientTo(LocalFrame&, PassOwnPtrWillBeRawPtr<NotificationPermissionClient>);
35 #endif // NotificationPermissionClient_h