Chromium Code Reviews| 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..f9291622ea4a075a741dc73a5c6abfc4f9a526bc |
| --- /dev/null |
| +++ b/content/renderer/presentation/presentation_dispatcher.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
|
Peter Beverloo
2015/01/07 15:13:01
nit: no (c).
whywhat
2015/01/07 18:03:00
Done.
|
| +// 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_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 mojo::InterfaceImpl<presentation::PresentationServiceClient> { |
| + public: |
| + explicit PresentationDispatcher(RenderFrame* render_frame); |
| + virtual ~PresentationDispatcher(); |
|
Peter Beverloo
2015/01/07 15:13:01
~PresentationDispatcher() override;
whywhat
2015/01/07 18:03:00
Done.
|
| + |
| + private: |
| + // WebPresentationClient |
|
Peter Beverloo
2015/01/07 15:13:01
nit: "WebPresentationClient implementation." or si
whywhat
2015/01/07 18:03:00
Done.
|
| + virtual void setController( |
| + blink::WebPresentationController* controller) override; |
|
Peter Beverloo
2015/01/07 15:13:01
We don't use "override" for Blink API methods (it
whywhat
2015/01/07 18:03:00
Done.
|
| + virtual void addDeviceAvailabilityListener() override; |
| + virtual void removeDeviceAvailabilityListener() override; |
| + |
| + // PresentationServiceClient |
| + void DeviceAvailabilityChanged(bool available) override; |
| + |
| + void DefaultPresentationStarted( |
| + presentation::PresentationSessionPtr session) override; |
| + |
| + void ConnectToPresentationServiceIfNeeded(); |
| + |
| + blink::WebPresentationController* controller_; |
| + presentation::PresentationServicePtr presentation_service_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |