OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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 | |
5 #ifndef CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | |
6 #define CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | |
7 | |
8 #include "content/common/presentation_service.mojom.h" | |
9 #include "content/public/renderer/render_frame_observer.h" | |
10 #include "third_party/WebKit/public/platform/WebPresentationClient.h" | |
11 | |
12 namespace content { | |
13 | |
14 // PresentationDispatcher is a delegate for Presentation API messages used by | |
15 // Blink. It forwards the calls to the Mojo PresentationService. | |
16 class PresentationDispatcher | |
17 : public RenderFrameObserver, | |
18 public blink::WebPresentationClient, | |
19 public mojo::InterfaceImpl<presentation::PresentationServiceClient> { | |
20 public: | |
21 explicit PresentationDispatcher(RenderFrame* render_frame); | |
22 ~PresentationDispatcher() override; | |
23 | |
24 private: | |
25 // WebPresentationClient implementation. | |
26 virtual void setController( | |
27 blink::WebPresentationController* controller); | |
28 virtual void addDeviceAvailabilityListener(); | |
29 virtual void removeDeviceAvailabilityListener(); | |
30 | |
31 // PresentationServiceClient implementation. | |
32 void DeviceAvailabilityChanged(bool available) override; | |
33 | |
34 void ConnectToPresentationServiceIfNeeded(); | |
35 | |
36 blink::WebPresentationController* controller_; | |
Peter Beverloo
2015/01/07 19:41:21
nit: maybe add a comment about controller_ being a
mlamouri (slow - plz ping)
2015/01/08 15:08:54
A comment pointing that it is a weak reference wou
whywhat
2015/01/08 17:28:53
Done.
whywhat
2015/01/08 17:28:53
Done.
| |
37 presentation::PresentationServicePtr presentation_service_; | |
38 }; | |
39 | |
40 } // namespace content | |
41 | |
42 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | |
OLD | NEW |