OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_ | 5 #ifndef CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_ |
6 #define CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_ | 6 #define CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "content/public/renderer/content_renderer_client.h" | 11 #include "content/public/renderer/content_renderer_client.h" |
12 | 12 |
13 namespace IPC { | 13 namespace IPC { |
14 class MessageFilter; | 14 class MessageFilter; |
15 } | 15 } |
16 | 16 |
17 namespace network_hints { | 17 namespace network_hints { |
18 class PrescientNetworkingDispatcher; | 18 class PrescientNetworkingDispatcher; |
19 } // namespace network_hints | 19 } // namespace network_hints |
20 | 20 |
21 namespace chromecast { | 21 namespace chromecast { |
22 namespace shell { | 22 namespace shell { |
23 class CastRenderProcessObserver; | 23 class CastRenderProcessObserver; |
24 | 24 |
25 // Adds any platform-specific bindings to the current frame. | 25 // Adds any platform-specific bindings to the current frame. |
26 void PlatformAddRendererNativeBindings(blink::WebLocalFrame* frame); | 26 void PlatformAddRendererNativeBindings(blink::WebLocalFrame* frame); |
27 | 27 |
28 class CastContentRendererClient : public content::ContentRendererClient { | 28 class CastContentRendererClient : public content::ContentRendererClient { |
29 public: | 29 public: |
30 CastContentRendererClient(); | 30 // Creates an implementation of CastContentRendererClient. Platform should |
| 31 // link in an implementation as needed. |
| 32 static scoped_ptr<CastContentRendererClient> Create(); |
| 33 |
31 ~CastContentRendererClient() override; | 34 ~CastContentRendererClient() override; |
32 | 35 |
33 // Returns any MessageFilters from the platform implementation that should | 36 // Returns any MessageFilters from the platform implementation that should |
34 // be added to the render process. | 37 // be added to the render process. |
35 std::vector<scoped_refptr<IPC::MessageFilter>> | 38 std::vector<scoped_refptr<IPC::MessageFilter>> |
36 PlatformGetRendererMessageFilters(); | 39 PlatformGetRendererMessageFilters(); |
37 | 40 |
38 // ContentRendererClient implementation: | 41 // ContentRendererClient implementation: |
39 void RenderThreadStarted() override; | 42 void RenderThreadStarted() override; |
40 void RenderViewCreated(content::RenderView* render_view) override; | 43 void RenderViewCreated(content::RenderView* render_view) override; |
41 void AddKeySystems( | 44 void AddKeySystems( |
42 std::vector< ::media::KeySystemInfo>* key_systems) override; | 45 std::vector< ::media::KeySystemInfo>* key_systems) override; |
43 #if !defined(OS_ANDROID) | 46 #if !defined(OS_ANDROID) |
44 scoped_ptr<::media::RendererFactory> CreateMediaRendererFactory( | 47 scoped_ptr<::media::RendererFactory> CreateMediaRendererFactory( |
45 content::RenderFrame* render_frame, | 48 content::RenderFrame* render_frame, |
46 const scoped_refptr<::media::MediaLog>& media_log) override; | 49 const scoped_refptr<::media::MediaLog>& media_log) override; |
47 #endif | 50 #endif |
48 blink::WebPrescientNetworking* GetPrescientNetworking() override; | 51 blink::WebPrescientNetworking* GetPrescientNetworking() override; |
49 void DeferMediaLoad(content::RenderFrame* render_frame, | 52 void DeferMediaLoad(content::RenderFrame* render_frame, |
50 const base::Closure& closure) override; | 53 const base::Closure& closure) override; |
51 | 54 |
| 55 protected: |
| 56 CastContentRendererClient(); |
| 57 |
52 private: | 58 private: |
53 scoped_ptr<network_hints::PrescientNetworkingDispatcher> | 59 scoped_ptr<network_hints::PrescientNetworkingDispatcher> |
54 prescient_networking_dispatcher_; | 60 prescient_networking_dispatcher_; |
55 scoped_ptr<CastRenderProcessObserver> cast_observer_; | 61 scoped_ptr<CastRenderProcessObserver> cast_observer_; |
56 | 62 |
57 DISALLOW_COPY_AND_ASSIGN(CastContentRendererClient); | 63 DISALLOW_COPY_AND_ASSIGN(CastContentRendererClient); |
58 }; | 64 }; |
59 | 65 |
60 } // namespace shell | 66 } // namespace shell |
61 } // namespace chromecast | 67 } // namespace chromecast |
62 | 68 |
63 #endif // CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_ | 69 #endif // CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_ |
OLD | NEW |