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

Side by Side Diff: Source/modules/presentation/PresentationController.h

Issue 832263007: Added plumbing for the availablechange event from Blink to WebPresentationClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added onClientDestroyed Created 5 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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 PresentationController_h
6 #define PresentationController_h
7
8 #include "core/frame/FrameDestructionObserver.h"
9 #include "modules/presentation/Presentation.h"
10 #include "platform/Supplementable.h"
11 #include "platform/heap/Handle.h"
12 #include "public/platform/WebPresentationController.h"
13
14 namespace blink {
15
16 class LocalFrame;
17 class WebPresentationClient;
18
19 // The coordinator between the various page exposed properties and the content
20 // layer represented via |WebPresentationClient|.
21 class PresentationController final
22 : public NoBaseWillBeGarbageCollectedFinalized<PresentationController>
23 , public WillBeHeapSupplement<LocalFrame>
24 , public FrameDestructionObserver
25 , public WebPresentationController {
26 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationController);
27 WTF_MAKE_NONCOPYABLE(PresentationController);
28 public:
29 virtual ~PresentationController();
30
31 static PassOwnPtrWillBeRawPtr<PresentationController> create(LocalFrame&, We bPresentationClient*);
32
33 static const char* supplementName();
34 static PresentationController* from(LocalFrame&);
35
36 static void provideTo(LocalFrame&, WebPresentationClient*);
37
38 // Implementation of HeapSupplement.
39 virtual void trace(Visitor*) override;
40
41 // Implementation of WebPresentationController.
42 virtual void didChangeAvailability(bool available) override;
43 virtual bool isAvailableChangeWatched() const override;
44 virtual void onClientDestroyed() override;
45
46 // Called when the first listener was added to or the last listener was remo ved from the
47 // |availablechange| event.
48 void updateAvailableChangeWatched(bool watched);
49
50 // Connects the |Presentation| object with this controller.
51 void setPresentation(Presentation*);
52
53 private:
54 PresentationController(LocalFrame&, WebPresentationClient*);
55
56 // Implementation of FrameDestructionObserver.
57 virtual void willDetachFrameHost() override;
58
59 WebPresentationClient* m_client;
60 PersistentWillBeMember<Presentation> m_presentation;
61 };
62
63 } // namespace blink
64
65 #endif // PresentationController_h
OLDNEW
« no previous file with comments | « Source/modules/presentation/Presentation.idl ('k') | Source/modules/presentation/PresentationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698