Chromium Code Reviews| 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; |
|
Peter Beverloo
2014/03/10 13:59:28
nit: nullptr is now preferred in Blink.
Michael van Ouwerkerk
2014/03/10 15:12:04
"return nullptr" does not compile. How is that not
|
| +} |
| + |
| +const char* PushController::supplementName() |
| +{ |
| + return "PushController"; |
| +} |
| + |
| +void providePushControllerTo(Page& page, blink::WebPushClient* client) |
| +{ |
| + PushController::provideTo(page, PushController::supplementName(), PushController::create(client)); |
| +} |
| + |
| +} // namespace WebCore |