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" |
(...skipping 28 matching lines...) Expand all Loading... |
39 virtual ExecutionContext* executionContext() const override; | 39 virtual ExecutionContext* executionContext() const override; |
40 | 40 |
41 DECLARE_VIRTUAL_TRACE(); | 41 DECLARE_VIRTUAL_TRACE(); |
42 | 42 |
43 PresentationSession* session() const; | 43 PresentationSession* session() const; |
44 | 44 |
45 ScriptPromise startSession(ScriptState*, const String& presentationUrl, cons
t String& presentationId); | 45 ScriptPromise startSession(ScriptState*, const String& presentationUrl, cons
t String& presentationId); |
46 ScriptPromise joinSession(ScriptState*, const String& presentationUrl, const
String& presentationId); | 46 ScriptPromise joinSession(ScriptState*, const String& presentationUrl, const
String& presentationId); |
47 | 47 |
48 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); | 48 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); |
| 49 DEFINE_ATTRIBUTE_EVENT_LISTENER(defaultpresentationstart); |
49 | 50 |
50 // The embedder needs to keep track if anything is listening to the event so
it could stop the | 51 // The embedder needs to keep track if anything is listening to the event so
it could stop the |
51 // might be expensive screen discovery process. | 52 // might be expensive screen discovery process. |
52 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) override; | 53 virtual bool addEventListener(const AtomicString& eventType, PassRefPtr<Even
tListener>, bool useCapture) override; |
53 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture) override; | 54 virtual bool removeEventListener(const AtomicString& eventType, PassRefPtr<E
ventListener>, bool useCapture) override; |
54 virtual void removeAllEventListeners() override; | 55 virtual void removeAllEventListeners() override; |
55 | 56 |
56 // Called when the |availablechange| event needs to be fired. | 57 // Called when the |availablechange| event needs to be fired. |
57 void didChangeAvailability(bool available); | 58 void didChangeAvailability(bool available); |
58 // Queried by the controller if |availablechange| event has any listeners. | 59 // Queried by the controller if |availablechange| event has any listeners. |
59 bool isAvailableChangeWatched() const; | 60 bool isAvailableChangeWatched() const; |
| 61 |
| 62 // Called when the |defaultpresentationstart| event needs to be fired. |
| 63 void didStartDefaultPresentation(PresentationSession*); |
| 64 // Queried by the controller if |defaultpresentationstart| event has any lis
teners. |
| 65 bool isDefaultPresentationStartWatched() const; |
| 66 |
60 // Adds a session to the open sessions list. | 67 // Adds a session to the open sessions list. |
61 void registerSession(PresentationSession*); | 68 void registerSession(PresentationSession*); |
62 | 69 |
63 private: | 70 private: |
64 explicit Presentation(LocalFrame*); | 71 explicit Presentation(LocalFrame*); |
65 | 72 |
66 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. | 73 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. |
67 // Can return |nullptr| if the frame is detached from the document. | 74 // Can return |nullptr| if the frame is detached from the document. |
68 PresentationController* presentationController(); | 75 PresentationController* presentationController(); |
69 | 76 |
70 // The session object provided to the presentation page. Not supported. | 77 // The session object provided to the presentation page. Not supported. |
71 Member<PresentationSession> m_session; | 78 Member<PresentationSession> m_session; |
72 | 79 |
73 // The sessions opened for this frame. | 80 // The sessions opened for this frame. |
74 HeapHashSet<Member<PresentationSession>> m_openSessions; | 81 HeapHashSet<Member<PresentationSession>> m_openSessions; |
75 }; | 82 }; |
76 | 83 |
77 } // namespace blink | 84 } // namespace blink |
78 | 85 |
79 #endif // Presentation_h | 86 #endif // Presentation_h |
OLD | NEW |