| 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/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "core/frame/DOMWindowProperty.h" | 9 #include "core/dom/ContextLifecycleObserver.h" |
| 10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 11 #include "platform/heap/Heap.h" | 11 #include "platform/heap/Heap.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 | 14 |
| 15 class LocalFrame; | 15 class LocalFrame; |
| 16 class PresentationReceiver; | 16 class PresentationReceiver; |
| 17 class PresentationRequest; | 17 class PresentationRequest; |
| 18 | 18 |
| 19 // Implements the main entry point of the Presentation API corresponding to the | 19 // Implements the main entry point of the Presentation API corresponding to the |
| 20 // Presentation.idl | 20 // Presentation.idl |
| 21 // See https://w3c.github.io/presentation-api/#navigatorpresentation for | 21 // See https://w3c.github.io/presentation-api/#navigatorpresentation for |
| 22 // details. | 22 // details. |
| 23 class Presentation final : public GarbageCollected<Presentation>, | 23 class Presentation final : public GarbageCollected<Presentation>, |
| 24 public ScriptWrappable, | 24 public ScriptWrappable, |
| 25 public DOMWindowProperty { | 25 public ContextClient { |
| 26 USING_GARBAGE_COLLECTED_MIXIN(Presentation); | 26 USING_GARBAGE_COLLECTED_MIXIN(Presentation); |
| 27 DEFINE_WRAPPERTYPEINFO(); | 27 DEFINE_WRAPPERTYPEINFO(); |
| 28 | 28 |
| 29 public: | 29 public: |
| 30 static Presentation* create(LocalFrame*); | 30 static Presentation* create(LocalFrame*); |
| 31 | 31 |
| 32 DECLARE_VIRTUAL_TRACE(); | 32 DECLARE_VIRTUAL_TRACE(); |
| 33 | 33 |
| 34 PresentationRequest* defaultRequest() const; | 34 PresentationRequest* defaultRequest() const; |
| 35 void setDefaultRequest(PresentationRequest*); | 35 void setDefaultRequest(PresentationRequest*); |
| 36 | 36 |
| 37 PresentationReceiver* receiver(); | 37 PresentationReceiver* receiver(); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 explicit Presentation(LocalFrame*); | 40 explicit Presentation(LocalFrame*); |
| 41 | 41 |
| 42 // Default PresentationRequest used by the embedder. | 42 // Default PresentationRequest used by the embedder. |
| 43 Member<PresentationRequest> m_defaultRequest; | 43 Member<PresentationRequest> m_defaultRequest; |
| 44 | 44 |
| 45 // PresentationReceiver instance. It will always be nullptr if the Blink | 45 // PresentationReceiver instance. It will always be nullptr if the Blink |
| 46 // instance is not running as a presentation receiver. | 46 // instance is not running as a presentation receiver. |
| 47 Member<PresentationReceiver> m_receiver; | 47 Member<PresentationReceiver> m_receiver; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace blink | 50 } // namespace blink |
| 51 | 51 |
| 52 #endif // Presentation_h | 52 #endif // Presentation_h |
| OLD | NEW |