| 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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 void didChangeAvailability(bool available); | 60 void didChangeAvailability(bool available); |
| 61 // Queried by the controller if |availablechange| event has any listeners. | 61 // Queried by the controller if |availablechange| event has any listeners. |
| 62 bool isAvailableChangeWatched() const; | 62 bool isAvailableChangeWatched() const; |
| 63 | 63 |
| 64 // Called when the |defaultsessionstart| event needs to be fired. | 64 // Called when the |defaultsessionstart| event needs to be fired. |
| 65 void didStartDefaultSession(PresentationSession*); | 65 void didStartDefaultSession(PresentationSession*); |
| 66 | 66 |
| 67 // Called when the |onstatechange| event needs to be fired to the right sess
ion. | 67 // Called when the |onstatechange| event needs to be fired to the right sess
ion. |
| 68 void didChangeSessionState(WebPresentationSessionClient*, WebPresentationSes
sionState); | 68 void didChangeSessionState(WebPresentationSessionClient*, WebPresentationSes
sionState); |
| 69 | 69 |
| 70 // Called when the |onmessage| event needs to be fired to the right session. |
| 71 void didReceiveSessionTextMessage(WebPresentationSessionClient*, const Strin
g& message); |
| 72 |
| 70 // Adds a session to the open sessions list. | 73 // Adds a session to the open sessions list. |
| 71 void registerSession(PresentationSession*); | 74 void registerSession(PresentationSession*); |
| 72 | 75 |
| 73 private: | 76 private: |
| 74 explicit Presentation(LocalFrame*); | 77 explicit Presentation(LocalFrame*); |
| 75 | 78 |
| 76 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. | 79 // Returns the |PresentationController| object associated with the frame |Pr
esentation| corresponds to. |
| 77 // Can return |nullptr| if the frame is detached from the document. | 80 // Can return |nullptr| if the frame is detached from the document. |
| 78 PresentationController* presentationController(); | 81 PresentationController* presentationController(); |
| 79 | 82 |
| 80 // Returns the session that matches the WebPresentationSessionClient or null
. | 83 // Returns the session that matches the WebPresentationSessionClient or null
. |
| 81 PresentationSession* findSession(WebPresentationSessionClient*); | 84 PresentationSession* findSession(WebPresentationSessionClient*); |
| 82 | 85 |
| 83 // The session object provided to the presentation page. Not supported. | 86 // The session object provided to the presentation page. Not supported. |
| 84 Member<PresentationSession> m_session; | 87 Member<PresentationSession> m_session; |
| 85 | 88 |
| 86 // The sessions opened for this frame. | 89 // The sessions opened for this frame. |
| 87 HeapHashSet<Member<PresentationSession>> m_openSessions; | 90 HeapHashSet<Member<PresentationSession>> m_openSessions; |
| 88 }; | 91 }; |
| 89 | 92 |
| 90 } // namespace blink | 93 } // namespace blink |
| 91 | 94 |
| 92 #endif // Presentation_h | 95 #endif // Presentation_h |
| OLD | NEW |