| OLD | NEW |
| (Empty) | |
| 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. |
| 4 |
| 5 #ifndef PushController_h |
| 6 #define PushController_h |
| 7 |
| 8 #include "core/page/Page.h" |
| 9 #include "wtf/Forward.h" |
| 10 #include "wtf/Noncopyable.h" |
| 11 |
| 12 namespace blink { |
| 13 |
| 14 class WebPushClient; |
| 15 |
| 16 } // namespace blink |
| 17 |
| 18 namespace WebCore { |
| 19 |
| 20 class PushController FINAL : public Supplement<Page> { |
| 21 WTF_MAKE_NONCOPYABLE(PushController); |
| 22 |
| 23 public: |
| 24 virtual ~PushController(); |
| 25 |
| 26 static PassOwnPtr<PushController> create(blink::WebPushClient*); |
| 27 static const char* supplementName(); |
| 28 static PushController* from(Page* page) { return static_cast<PushController*
>(Supplement<Page>::from(page, supplementName())); } |
| 29 static blink::WebPushClient* clientFrom(Page*); |
| 30 |
| 31 blink::WebPushClient* client() const { return m_client; } |
| 32 |
| 33 private: |
| 34 explicit PushController(blink::WebPushClient*); |
| 35 |
| 36 blink::WebPushClient* m_client; |
| 37 }; |
| 38 |
| 39 void providePushControllerTo(Page&, blink::WebPushClient*); |
| 40 |
| 41 } // namespace WebCore |
| 42 |
| 43 #endif // PushController_h |
| OLD | NEW |