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..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); |
|
mark a. foltz
2015/01/27 21:56:09
override?
whywhat
2015/01/28 01:52:38
As suggested by another reviewer, implementations
|
| + virtual void updateAvailableChangeWatched(bool watched); |
|
mark a. foltz
2015/01/27 21:56:09
override?
whywhat
2015/01/28 01:52:38
Ditto.
|
| + |
| + void OnScreenAvailabilityChanged(bool available); |
| + |
| + void ConnectToPresentationServiceIfNeeded(); |
| + |
| + // Used as a weak reference. Can be null since lifetime is bound to the frame. |
|
mark a. foltz
2015/01/27 21:56:09
Should this be refcounted? Or is it simply set or
whywhat
2015/01/28 01:52:38
Yes, controller lives on the Blink heap (Oilpan) s
|
| + blink::WebPresentationController* controller_; |
|
mark a. foltz
2015/01/27 21:56:09
Does this need fwd declaration?
whywhat
2015/01/28 01:52:38
Not really since WebPresentationClient already for
|
| + presentation::PresentationServicePtr presentation_service_; |
|
mark a. foltz
2015/01/27 21:56:09
Ditto
whywhat
2015/01/28 01:52:38
This is defined in the presentation_service.mojom.
|
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ |