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
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_
6 #define CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_
10 #include "base/macros.h"
11 #include "content/public/renderer/content_renderer_client.h"
17 namespace network_hints
{
18 class PrescientNetworkingDispatcher
;
19 } // namespace network_hints
21 namespace chromecast
{
23 class CastRenderProcessObserver
;
25 class CastContentRendererClient
: public content::ContentRendererClient
{
27 // Creates an implementation of CastContentRendererClient. Platform should
28 // link in an implementation as needed.
29 static scoped_ptr
<CastContentRendererClient
> Create();
31 ~CastContentRendererClient() override
;
33 // Adds any platform-specific bindings to the current frame.
34 virtual void AddRendererNativeBindings(blink::WebLocalFrame
* frame
);
36 // Returns any MessageFilters from the platform implementation that should
37 // be added to the render process.
38 virtual std::vector
<scoped_refptr
<IPC::MessageFilter
>>
39 GetRendererMessageFilters();
41 // ContentRendererClient implementation:
42 void RenderThreadStarted() override
;
43 void RenderViewCreated(content::RenderView
* render_view
) override
;
45 std::vector
< ::media::KeySystemInfo
>* key_systems
) override
;
46 #if !defined(OS_ANDROID)
47 scoped_ptr
<::media::RendererFactory
> CreateMediaRendererFactory(
48 content::RenderFrame
* render_frame
,
49 const scoped_refptr
<::media::GpuVideoAcceleratorFactories
>& gpu_factories
,
50 const scoped_refptr
<::media::MediaLog
>& media_log
) override
;
52 blink::WebPrescientNetworking
* GetPrescientNetworking() override
;
53 void DeferMediaLoad(content::RenderFrame
* render_frame
,
54 const base::Closure
& closure
) override
;
57 CastContentRendererClient();
60 scoped_ptr
<network_hints::PrescientNetworkingDispatcher
>
61 prescient_networking_dispatcher_
;
62 scoped_ptr
<CastRenderProcessObserver
> cast_observer_
;
64 DISALLOW_COPY_AND_ASSIGN(CastContentRendererClient
);
68 } // namespace chromecast
70 #endif // CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_