| 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 |
| 60 // Adds a session to the open sessions list. | 65 // Adds a session to the open sessions list. |
| 61 void registerSession(PresentationSession*); | 66 void registerSession(PresentationSession*); |
| 62 | 67 |
| 63 private: | 68 private: |
| 64 explicit Presentation(LocalFrame*); | 69 explicit Presentation(LocalFrame*); |
| 65 | 70 |
| 66 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. | 71 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. |
| 67 // Can return |nullptr| if the frame is detached from the document. | 72 // Can return |nullptr| if the frame is detached from the document. |
| 68 PresentationController* presentationController(); | 73 PresentationController* presentationController(); |
| 69 | 74 |
| 70 // The session object provided to the presentation page. Not supported. | 75 // The session object provided to the presentation page. Not supported. |
| 71 Member<PresentationSession> m_session; | 76 Member<PresentationSession> m_session; |
| 72 | 77 |
| 73 // The sessions opened for this frame. | 78 // The sessions opened for this frame. |
| 74 HeapHashSet<Member<PresentationSession>> m_openSessions; | 79 HeapHashSet<Member<PresentationSession>> m_openSessions; |
| 75 }; | 80 }; |
| 76 | 81 |
| 77 } // namespace blink | 82 } // namespace blink |
| 78 | 83 |
| 79 #endif // Presentation_h | 84 #endif // Presentation_h |
| OLD | NEW |