| Index: content/renderer/presentation/presentation_dispatcher.h
|
| diff --git a/content/renderer/presentation/presentation_dispatcher.h b/content/renderer/presentation/presentation_dispatcher.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9284b4ee5e09e1036a3904cc97f075fdf228ea1a
|
| --- /dev/null
|
| +++ b/content/renderer/presentation/presentation_dispatcher.h
|
| @@ -0,0 +1,40 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
|
| +#define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
|
| +
|
| +#include "content/common/presentation/presentation_service.mojom.h"
|
| +#include "content/public/renderer/render_frame_observer.h"
|
| +#include "third_party/WebKit/public/platform/WebPresentationClient.h"
|
| +
|
| +namespace content {
|
| +
|
| +// PresentationDispatcher is a delegate for Presentation API messages used by
|
| +// Blink. It forwards the calls to the Mojo PresentationService.
|
| +class PresentationDispatcher
|
| + : public RenderFrameObserver,
|
| + public blink::WebPresentationClient {
|
| + public:
|
| + explicit PresentationDispatcher(RenderFrame* render_frame);
|
| + ~PresentationDispatcher() override;
|
| +
|
| + private:
|
| + // WebPresentationClient implementation.
|
| + virtual void setController(
|
| + blink::WebPresentationController* controller);
|
| + virtual void updateAvailableChangeWatched(bool watched);
|
| +
|
| + void OnScreenAvailabilityChanged(bool available);
|
| +
|
| + void ConnectToPresentationServiceIfNeeded();
|
| +
|
| + // Used as a weak reference. Can be null since lifetime is bound to the frame.
|
| + blink::WebPresentationController* controller_;
|
| + presentation::PresentationServicePtr presentation_service_;
|
| +};
|
| +
|
| +} // namespace content
|
| +
|
| +#endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_
|
|
|