| 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 PresentationSession_h |
| 6 #define Presentation_h | 6 #define PresentationSession_h |
| 7 | 7 |
| 8 #include "core/dom/ContextLifecycleObserver.h" | 8 #include "core/dom/ContextLifecycleObserver.h" |
| 9 #include "core/events/EventTarget.h" | 9 #include "core/events/EventTarget.h" |
| 10 #include "wtf/text/WTFString.h" |
| 10 | 11 |
| 11 namespace blink { | 12 namespace blink { |
| 12 | 13 |
| 13 class Presentation final | 14 class PresentationSession final |
| 14 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Presentat
ion> | 15 : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Presentat
ionSession> |
| 15 , public EventTargetWithInlineData | 16 , public EventTargetWithInlineData |
| 16 , public ContextLifecycleObserver { | 17 , public ContextLifecycleObserver { |
| 17 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentation>); | 18 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P
resentationSession>); |
| 18 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); | 19 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PresentationSession); |
| 19 DEFINE_WRAPPERTYPEINFO(); | 20 DEFINE_WRAPPERTYPEINFO(); |
| 20 public: | 21 public: |
| 21 static Presentation* create(ExecutionContext*); | 22 static PresentationSession* create(ExecutionContext*); |
| 22 virtual ~Presentation(); | 23 virtual ~PresentationSession(); |
| 23 | 24 |
| 24 // EventTarget implementation. | 25 // EventTarget implementation. |
| 25 virtual const AtomicString& interfaceName() const override; | 26 virtual const AtomicString& interfaceName() const override; |
| 26 virtual ExecutionContext* executionContext() const override; | 27 virtual ExecutionContext* executionContext() const override; |
| 27 | 28 |
| 28 virtual void trace(Visitor*) override; | 29 virtual void trace(Visitor*) override; |
| 29 | 30 |
| 30 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); | 31 const String& id() const { return m_id; } |
| 32 const AtomicString& state() const { return m_state; } |
| 33 |
| 34 void postMessage(const String& message); |
| 35 void close(); |
| 36 |
| 37 DEFINE_ATTRIBUTE_EVENT_LISTENER(message); |
| 38 DEFINE_ATTRIBUTE_EVENT_LISTENER(statechange); |
| 31 | 39 |
| 32 private: | 40 private: |
| 33 explicit Presentation(ExecutionContext*); | 41 explicit PresentationSession(ExecutionContext*); |
| 42 |
| 43 String m_id; |
| 44 AtomicString m_state; |
| 34 }; | 45 }; |
| 35 | 46 |
| 36 } // namespace blink | 47 } // namespace blink |
| 37 | 48 |
| 38 #endif // Presentation_h | 49 #endif // PresentationSession_h |
| OLD | NEW |