Chromium Code Reviews| 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/dom/ContextLifecycleObserver.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 10 #include "core/events/EventTarget.h" | 10 #include "core/events/EventTarget.h" |
| 11 #include "modules/presentation/PresentationSession.h" | 11 #include "modules/presentation/PresentationSession.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class PresentationController; | |
| 15 class ScriptState; | 16 class ScriptState; |
| 16 | 17 |
| 17 class Presentation final | 18 class Presentation final |
| 18 : public RefCountedGarbageCollectedEventTargetWithInlineData<Presentation> | 19 : public RefCountedGarbageCollectedEventTargetWithInlineData<Presentation> |
| 19 , public ContextLifecycleObserver { | 20 , public ContextLifecycleObserver { |
| 20 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P resentation>); | 21 DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<P resentation>); |
| 21 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); | 22 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Presentation); |
| 22 DEFINE_WRAPPERTYPEINFO(); | 23 DEFINE_WRAPPERTYPEINFO(); |
| 23 public: | 24 public: |
| 24 static Presentation* create(ExecutionContext*); | 25 static Presentation* create(ExecutionContext*); |
| 25 virtual ~Presentation(); | 26 virtual ~Presentation(); |
| 26 | 27 |
| 27 // EventTarget implementation. | 28 // EventTarget implementation. |
| 28 virtual const AtomicString& interfaceName() const override; | 29 virtual const AtomicString& interfaceName() const override; |
| 29 virtual ExecutionContext* executionContext() const override; | 30 virtual ExecutionContext* executionContext() const override; |
| 30 | 31 |
| 31 virtual void trace(Visitor*) override; | 32 virtual void trace(Visitor*) override; |
| 32 | 33 |
| 33 PresentationSession* session() const; | 34 PresentationSession* session() const; |
| 34 | 35 |
| 35 ScriptPromise startSession(ScriptState*, const String& senderId, const Strin g& presentationId); | 36 ScriptPromise startSession(ScriptState*, const String& senderId, const Strin g& presentationId); |
| 36 ScriptPromise joinSession(ScriptState*, const String& senderId, const String & presentationId); | 37 ScriptPromise joinSession(ScriptState*, const String& senderId, const String & presentationId); |
| 37 | 38 |
| 38 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); | 39 DEFINE_ATTRIBUTE_EVENT_LISTENER(availablechange); |
| 39 | 40 |
| 41 virtual bool addEventListener(const AtomicString&, PassRefPtr<EventListener> , bool) override; | |
|
Peter Beverloo
2015/01/07 14:29:09
Please give the "AtomicString" and "bool" argument
whywhat
2015/01/07 16:22:16
Done.
| |
| 42 virtual bool removeEventListener(const AtomicString&, PassRefPtr<EventListen er>, bool) override; | |
| 43 | |
| 44 void deviceAvailabilityChanged(bool available); | |
| 40 private: | 45 private: |
| 41 explicit Presentation(ExecutionContext*); | 46 explicit Presentation(ExecutionContext*); |
| 42 | 47 |
| 48 PresentationController* presentationController(); | |
| 49 LocalFrame* frame(); | |
| 50 | |
| 43 Member<PresentationSession> m_session; | 51 Member<PresentationSession> m_session; |
| 44 }; | 52 }; |
| 45 | 53 |
| 46 } // namespace blink | 54 } // namespace blink |
| 47 | 55 |
| 48 #endif // Presentation_h | 56 #endif // Presentation_h |
| OLD | NEW |