| 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 #include "modules/push_messaging/PushController.h" | 5 #include "modules/push_messaging/PushController.h" |
| 6 | 6 |
| 7 #include "platform/wtf/Assertions.h" |
| 7 #include "public/platform/modules/push_messaging/WebPushClient.h" | 8 #include "public/platform/modules/push_messaging/WebPushClient.h" |
| 8 #include "wtf/Assertions.h" | |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 PushController::PushController(LocalFrame& frame, WebPushClient* client) | 12 PushController::PushController(LocalFrame& frame, WebPushClient* client) |
| 13 : Supplement<LocalFrame>(frame), client_(client) {} | 13 : Supplement<LocalFrame>(frame), client_(client) {} |
| 14 | 14 |
| 15 WebPushClient& PushController::ClientFrom(LocalFrame* frame) { | 15 WebPushClient& PushController::ClientFrom(LocalFrame* frame) { |
| 16 PushController* controller = PushController::From(frame); | 16 PushController* controller = PushController::From(frame); |
| 17 DCHECK(controller); | 17 DCHECK(controller); |
| 18 WebPushClient* client = controller->Client(); | 18 WebPushClient* client = controller->Client(); |
| 19 DCHECK(client); | 19 DCHECK(client); |
| 20 return *client; | 20 return *client; |
| 21 } | 21 } |
| 22 | 22 |
| 23 const char* PushController::SupplementName() { | 23 const char* PushController::SupplementName() { |
| 24 return "PushController"; | 24 return "PushController"; |
| 25 } | 25 } |
| 26 | 26 |
| 27 void ProvidePushControllerTo(LocalFrame& frame, WebPushClient* client) { | 27 void ProvidePushControllerTo(LocalFrame& frame, WebPushClient* client) { |
| 28 PushController::ProvideTo(frame, PushController::SupplementName(), | 28 PushController::ProvideTo(frame, PushController::SupplementName(), |
| 29 new PushController(frame, client)); | 29 new PushController(frame, client)); |
| 30 } | 30 } |
| 31 | 31 |
| 32 } // namespace blink | 32 } // namespace blink |
| OLD | NEW |