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

Side by Side Diff: Source/modules/push_messaging/PushController.h

Issue 687933002: Move push client to frame. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef PushController_h 5 #ifndef PushController_h
6 #define PushController_h 6 #define PushController_h
7 7
8 #include "core/page/Page.h" 8 #include "core/frame/LocalFrame.h"
9 #include "platform/Supplementable.h" 9 #include "platform/Supplementable.h"
10 #include "wtf/Forward.h" 10 #include "wtf/Forward.h"
11 #include "wtf/Noncopyable.h" 11 #include "wtf/Noncopyable.h"
12 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class WebPushClient; 16 class WebPushClient;
17 17
18 class PushController final : public NoBaseWillBeGarbageCollected<PushController> , public WillBeHeapSupplement<Page> { 18 class PushController final : public NoBaseWillBeGarbageCollected<PushController> , public WillBeHeapSupplement<LocalFrame> {
Peter Beverloo 2014/10/29 11:25:07 This will only be used for requesting permission,
Michael van Ouwerkerk 2014/11/11 17:20:06 This will also plumb through a sender id from the
19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController); 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PushController);
20 WTF_MAKE_NONCOPYABLE(PushController); 20 WTF_MAKE_NONCOPYABLE(PushController);
21 21
22 public: 22 public:
23 static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*); 23 static PassOwnPtrWillBeRawPtr<PushController> create(WebPushClient*);
24 static const char* supplementName(); 24 static const char* supplementName();
25 static PushController* from(Page* page) { return static_cast<PushController* >(WillBeHeapSupplement<Page>::from(page, supplementName())); } 25 static PushController* from(LocalFrame* frame) { return static_cast<PushCont roller*>(WillBeHeapSupplement<LocalFrame>::from(frame, supplementName())); }
26 static WebPushClient* clientFrom(Page*); 26 static WebPushClient* clientFrom(LocalFrame*);
27 27
28 WebPushClient* client() const { return m_client; } 28 WebPushClient* client() const { return m_client; }
Peter Beverloo 2014/10/29 11:25:07 nit: this should be private.
Michael van Ouwerkerk 2014/11/11 17:20:06 Actually, I think this method is not needed at all
29 29
30 virtual void trace(Visitor* visitor) override { WillBeHeapSupplement<Page>:: trace(visitor); } 30 virtual void trace(Visitor* visitor) override { WillBeHeapSupplement<LocalFr ame>::trace(visitor); }
31 31
32 private: 32 private:
33 explicit PushController(WebPushClient*); 33 explicit PushController(WebPushClient*);
34 34
35 WebPushClient* m_client; 35 WebPushClient* m_client;
36 }; 36 };
37 37
38 void providePushControllerTo(Page&, WebPushClient*); 38 void providePushControllerTo(LocalFrame&, WebPushClient*);
39 39
40 } // namespace blink 40 } // namespace blink
41 41
42 #endif // PushController_h 42 #endif // PushController_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/push_messaging/PushController.cpp » ('j') | Source/modules/push_messaging/PushManager.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698