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/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: | |
20 explicit PresentationDispatcher(RenderFrame* render_frame); | |
21 ~PresentationDispatcher() override; | |
22 | |
23 private: | |
24 // WebPresentationClient implementation. | |
25 virtual void setController( | |
26 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
| |
27 virtual void updateAvailableChangeWatched(bool watched); | |
mark a. foltz
2015/01/27 21:56:09
override?
whywhat
2015/01/28 01:52:38
Ditto.
| |
28 | |
29 void OnScreenAvailabilityChanged(bool available); | |
30 | |
31 void ConnectToPresentationServiceIfNeeded(); | |
32 | |
33 // 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
| |
34 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
| |
35 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.
| |
36 }; | |
37 | |
38 } // namespace content | |
39 | |
40 #endif // CONTENT_RENDERER_PRESENTATION_PRESENTATION_DISPATCHER_H_ | |
OLD | NEW |