| Index: content/renderer/presentation/presentation_dispatcher.h
|
| diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h
|
| index 4642a644ba19899a626ce3a0db05f8e070d277cf..2dbf07c3f1387b0d1b7f34bf4c3d39a4221eda57 100644
|
| --- a/content/renderer/presentation/presentation_dispatcher.h
|
| +++ b/content/renderer/presentation/presentation_dispatcher.h
|
| @@ -6,6 +6,7 @@
|
| #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
|
|
|
| #include "base/compiler_specific.h"
|
| +#include "base/id_map.h"
|
| #include "base/memory/linked_ptr.h"
|
| #include "content/common/content_export.h"
|
| #include "content/common/presentation/presentation_service.mojom.h"
|
| @@ -13,6 +14,7 @@
|
| #include "third_party/WebKit/public/platform/modules/presentation/WebPresentationClient.h"
|
|
|
| namespace blink {
|
| +class WebPresentationAvailabilityObserver;
|
| class WebString;
|
| } // namespace blink
|
|
|
| @@ -58,6 +60,11 @@ class CONTENT_EXPORT PresentationDispatcher
|
| virtual void closeSession(
|
| const blink::WebString& presentationUrl,
|
| const blink::WebString& presentationId);
|
| + virtual void getAvailability(
|
| + const blink::WebString& presentationUrl,
|
| + blink::WebPresentationAvailabilityCallbacks* callbacks);
|
| + virtual void startListening(blink::WebPresentationAvailabilityObserver*);
|
| + virtual void stopListening(blink::WebPresentationAvailabilityObserver*);
|
|
|
| // RenderFrameObserver implementation.
|
| void DidChangeDefaultPresentation() override;
|
| @@ -84,6 +91,8 @@ class CONTENT_EXPORT PresentationDispatcher
|
|
|
| void ConnectToPresentationServiceIfNeeded();
|
|
|
| + void UpdateListeningState();
|
| +
|
| // Used as a weak reference. Can be null since lifetime is bound to the frame.
|
| blink::WebPresentationController* controller_;
|
| presentation::PresentationServicePtr presentation_service_;
|
| @@ -95,6 +104,23 @@ class CONTENT_EXPORT PresentationDispatcher
|
| std::queue<linked_ptr<presentation::SessionMessage>>;
|
| MessageRequestQueue message_request_queue_;
|
|
|
| + enum class ListeningState {
|
| + Inactive,
|
| + Waiting,
|
| + Active,
|
| + };
|
| +
|
| + ListeningState listening_state_;
|
| + bool last_known_availability_;
|
| +
|
| + using AvailabilityCallbacksMap =
|
| + IDMap<blink::WebPresentationAvailabilityCallbacks, IDMapOwnPointer>;
|
| + AvailabilityCallbacksMap availability_callbacks_;
|
| +
|
| + using AvailabilityObserversSet =
|
| + std::set<blink::WebPresentationAvailabilityObserver*>;
|
| + AvailabilityObserversSet availability_observers_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PresentationDispatcher);
|
| };
|
|
|
|
|