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

Unified Diff: Source/modules/pushmessaging/PushController.cpp

Issue 152763002: DO NOT REVIEW Bindings and plumbing for push messaging API. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. Address some review comments. Created 6 years, 9 months 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
« no previous file with comments | « Source/modules/pushmessaging/PushController.h ('k') | Source/modules/pushmessaging/PushManager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/pushmessaging/PushController.cpp
diff --git a/Source/modules/pushmessaging/PushController.cpp b/Source/modules/pushmessaging/PushController.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6e1cbb8cc437b31565ed01590fcbd34294e1b97d
--- /dev/null
+++ b/Source/modules/pushmessaging/PushController.cpp
@@ -0,0 +1,44 @@
+// 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.
+
+#include "config.h"
+#include "modules/pushmessaging/PushController.h"
+
+#include "public/platform/WebPushClient.h"
+#include "wtf/PassOwnPtr.h"
+
+namespace WebCore {
+
+PushController::PushController(blink::WebPushClient* client)
+ : m_client(client)
+{
+}
+
+PushController::~PushController()
+{
+}
+
+PassOwnPtr<PushController> PushController::create(blink::WebPushClient* client)
+{
+ return adoptPtr(new PushController(client));
+}
+
+blink::WebPushClient* PushController::clientFrom(Page* page)
+{
+ if (PushController* controller = PushController::from(page))
+ return controller->client();
+ return 0;
+}
+
+const char* PushController::supplementName()
+{
+ return "PushController";
+}
+
+void providePushControllerTo(Page& page, blink::WebPushClient* client)
+{
+ PushController::provideTo(page, PushController::supplementName(), PushController::create(client));
+}
+
+} // namespace WebCore
« no previous file with comments | « Source/modules/pushmessaging/PushController.h ('k') | Source/modules/pushmessaging/PushManager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698