| 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 PresentationSession_h | 5 #ifndef PresentationSession_h |
| 6 #define PresentationSession_h | 6 #define PresentationSession_h |
| 7 | 7 |
| 8 #include "core/events/EventTarget.h" | 8 #include "core/events/EventTarget.h" |
| 9 #include "core/frame/DOMWindowProperty.h" | 9 #include "core/frame/DOMWindowProperty.h" |
| 10 #include "wtf/text/AtomicString.h" | 10 #include "wtf/text/AtomicString.h" |
| 11 #include "wtf/text/WTFString.h" | 11 #include "wtf/text/WTFString.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class Presentation; | 15 class Presentation; |
| 16 class PresentationController; |
| 16 class WebPresentationSessionClient; | 17 class WebPresentationSessionClient; |
| 17 class WebString; | 18 class WebString; |
| 18 | 19 |
| 19 class PresentationSession final | 20 class PresentationSession final |
| 20 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes
sion> | 21 : public RefCountedGarbageCollectedEventTargetWithInlineData<PresentationSes
sion> |
| 21 , public DOMWindowProperty { | 22 , public DOMWindowProperty { |
| 22 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentationSession>); | 23 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentationSession>); |
| 23 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); | 24 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); |
| 24 DEFINE_WRAPPERTYPEINFO(); | 25 DEFINE_WRAPPERTYPEINFO(); |
| 25 public: | 26 public: |
| (...skipping 10 matching lines...) Expand all Loading... |
| 36 const String& id() const { return m_id; } | 37 const String& id() const { return m_id; } |
| 37 const AtomicString& state() const { return m_state; } | 38 const AtomicString& state() const { return m_state; } |
| 38 | 39 |
| 39 void postMessage(const String& message); | 40 void postMessage(const String& message); |
| 40 void close(); | 41 void close(); |
| 41 | 42 |
| 42 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); | 43 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 43 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); | 44 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 44 | 45 |
| 45 private: | 46 private: |
| 46 PresentationSession(LocalFrame*, const WebString& id); | 47 PresentationSession(LocalFrame*, const WebString& id, const WebString& url); |
| 48 |
| 49 // Returns the |PresentationController| object associated with the frame |
| 50 // |Presentation| corresponds to. Can return |nullptr| if the frame is |
| 51 // detached from the document. |
| 52 PresentationController* presentationController(); |
| 47 | 53 |
| 48 String m_id; | 54 String m_id; |
| 55 String m_url; |
| 49 AtomicString m_state; | 56 AtomicString m_state; |
| 50 }; | 57 }; |
| 51 | 58 |
| 52 } // namespace blink | 59 } // namespace blink |
| 53 | 60 |
| 54 #endif // PresentationSession_h | 61 #endif // PresentationSession_h |
| OLD | NEW |