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

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: Fixed Presentation API links Created 5 years, 11 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
45 // Called when the first listener was added to or the last listener was remo ved from the
46 // |availablechange| event.
47 void updateAvailableChangeWatched(bool watched);
48
49 // Connects the |Presentation| object with this controller.
50 void setPresentation(Presentation*);
51
52 private:
53 PresentationController(LocalFrame&, WebPresentationClient*);
54
55 // Implementation of FrameDestructionObserver.
56 virtual void willDetachFrameHost() override;
57
58 WebPresentationClient* m_client;
59 PersistentWillBeMember<Presentation> m_presentation;
60 };
61
62 } // namespace blink
63
64 #endif // PresentationController_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698