Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1402)

Unified Diff: Source/modules/push_messaging/PushPermissionClient.h

Issue 707833002: Plumb Push API permission request through Blink using Frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Delete random whitespace. Similarity=70 Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/modules/push_messaging/PushPermissionClient.h
diff --git a/Source/modules/push_messaging/PushPermissionClient.h b/Source/modules/push_messaging/PushPermissionClient.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a377309b47399258789058e07b6732c89828b7e
--- /dev/null
+++ b/Source/modules/push_messaging/PushPermissionClient.h
@@ -0,0 +1,35 @@
+// 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 PushPermissionClient_h
+#define PushPermissionClient_h
+
+#include "platform/Supplementable.h"
+#include "public/platform/WebCallback.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace blink {
+
+class ExecutionContext;
+class LocalFrame;
+
+class PushPermissionClient : public WillBeHeapSupplement<LocalFrame> {
+public:
+ virtual ~PushPermissionClient() { }
+
+ // Requests user permission to use the Push API from the origin of the
+ // current frame. The provided callback will be run when a decision has been
+ // made.
+ virtual void requestPermission(ExecutionContext*, WebCallback*) = 0;
+
+ // WillBeHeapSupplement requirements.
+ static const char* supplementName();
+ static PushPermissionClient* from(ExecutionContext*);
+};
+
+void providePushPermissionClientTo(LocalFrame&, PassOwnPtrWillBeRawPtr<PushPermissionClient>);
+
+} // namespace blink
+
+#endif // PushPermissionClient_h

Powered by Google App Engine
This is Rietveld 408576698