presentation.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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
  3. // found in the LICENSE file.
  4. #ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_PRESENTATION_PRESENTATION_H_
  5. #define THIRD_PARTY_BLINK_RENDERER_MODULES_PRESENTATION_PRESENTATION_H_
  6. #include "third_party/blink/renderer/core/execution_context/execution_context_lifecycle_observer.h"
  7. #include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
  8. #include "third_party/blink/renderer/platform/heap/handle.h"
  9. #include "third_party/blink/renderer/platform/heap/heap.h"
  10. namespace blink {
  11. class LocalDOMWindow;
  12. class PresentationReceiver;
  13. class PresentationRequest;
  14. // Implements the main entry point of the Presentation API corresponding to the
  15. // Presentation.idl
  16. // See https://w3c.github.io/presentation-api/#navigatorpresentation for
  17. // details.
  18. class Presentation final : public ScriptWrappable,
  19. public ExecutionContextClient {
  20. DEFINE_WRAPPERTYPEINFO();
  21. public:
  22. static Presentation* Create(LocalDOMWindow*);
  23. explicit Presentation(LocalDOMWindow*);
  24. void Trace(Visitor*) const override;
  25. PresentationRequest* defaultRequest() const;
  26. void setDefaultRequest(PresentationRequest*);
  27. PresentationReceiver* receiver();
  28. private:
  29. // Default PresentationRequest used by the embedder.
  30. Member<PresentationRequest> default_request_;
  31. // PresentationReceiver instance. It will always be nullptr if the Blink
  32. // instance is not running as a presentation receiver.
  33. Member<PresentationReceiver> receiver_;
  34. };
  35. } // namespace blink
  36. #endif // THIRD_PARTY_BLINK_RENDERER_MODULES_PRESENTATION_PRESENTATION_H_