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 #ifndef Presentation_h | 5 #ifndef Presentation_h |
6 #define Presentation_h | 6 #define Presentation_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptPromise.h" | 8 #include "bindings/core/v8/ScriptPromise.h" |
9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
10 #include "core/frame/DOMWindowProperty.h" | 10 #include "core/frame/DOMWindowProperty.h" |
11 #include "modules/presentation/PresentationSession.h" | 11 #include "modules/presentation/PresentationSession.h" |
12 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
13 #include "platform/heap/Heap.h" | 13 #include "platform/heap/Heap.h" |
14 | 14 |
15 namespace WTF { | 15 namespace WTF { |
16 class String; | 16 class String; |
17 } // namespace WTF | 17 } // namespace WTF |
18 | 18 |
19 namespace blink { | 19 namespace blink { |
20 | 20 |
21 class LocalFrame; | 21 class LocalFrame; |
22 class PresentationController; | 22 class PresentationController; |
23 class ScriptState; | 23 class ScriptState; |
| 24 class WebPresentationSessionClient; |
24 | 25 |
25 // Implements the main entry point of the Presentation API corresponding to the
Presentation.idl | 26 // Implements the main entry point of the Presentation API corresponding to the
Presentation.idl |
26 // See https://w3c.github.io/presentation-api/#navigatorpresentation for details
. | 27 // See https://w3c.github.io/presentation-api/#navigatorpresentation for details
. |
27 class Presentation final | 28 class Presentation final |
28 : public RefCountedGarbageCollectedEventTargetWithInlineData<Presentation> | 29 : public RefCountedGarbageCollectedEventTargetWithInlineData<Presentation> |
29 , public DOMWindowProperty { | 30 , public DOMWindowProperty { |
30 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentation>); | 31 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentation>); |
31 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); | 32 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); |
32 DEFINE_WRAPPERTYPEINFO(); | 33 DEFINE_WRAPPERTYPEINFO(); |
33 public: | 34 public: |
(...skipping 24 matching lines...) Expand all Loading... |
58 void didChangeAvailability(bool available); | 59 void didChangeAvailability(bool available); |
59 // Queried by the controller if |availablechange| event has any listeners. | 60 // Queried by the controller if |availablechange| event has any listeners. |
60 bool isAvailableChangeWatched() const; | 61 bool isAvailableChangeWatched() const; |
61 | 62 |
62 // Called when the |defaultsessionstart| event needs to be fired. | 63 // Called when the |defaultsessionstart| event needs to be fired. |
63 void didStartDefaultSession(PresentationSession*); | 64 void didStartDefaultSession(PresentationSession*); |
64 | 65 |
65 // Adds a session to the open sessions list. | 66 // Adds a session to the open sessions list. |
66 void registerSession(PresentationSession*); | 67 void registerSession(PresentationSession*); |
67 | 68 |
| 69 // Returns the session that matches the WebPresentationSessionClient or null
. |
| 70 PresentationSession* findSession(WebPresentationSessionClient*); |
| 71 |
68 private: | 72 private: |
69 explicit Presentation(LocalFrame*); | 73 explicit Presentation(LocalFrame*); |
70 | 74 |
71 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. | 75 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. |
72 // Can return |nullptr| if the frame is detached from the document. | 76 // Can return |nullptr| if the frame is detached from the document. |
73 PresentationController* presentationController(); | 77 PresentationController* presentationController(); |
74 | 78 |
75 // The session object provided to the presentation page. Not supported. | 79 // The session object provided to the presentation page. Not supported. |
76 Member<PresentationSession> m_session; | 80 Member<PresentationSession> m_session; |
77 | 81 |
78 // The sessions opened for this frame. | 82 // The sessions opened for this frame. |
79 HeapHashSet<Member<PresentationSession>> m_openSessions; | 83 HeapHashSet<Member<PresentationSession>> m_openSessions; |
80 }; | 84 }; |
81 | 85 |
82 } // namespace blink | 86 } // namespace blink |
83 | 87 |
84 #endif // Presentation_h | 88 #endif // Presentation_h |
OLD | NEW |