Roll src/third_party/WebKit 3aea697:d9c6159 (svn 201973:201974)
[chromium-blink-merge.git] / chromecast / renderer / cast_content_renderer_client.h
blob284df4e69178d32db6ff69f0403c874e9bcf212d
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_
8 #include <vector>
10 #include "base/macros.h"
11 #include "content/public/renderer/content_renderer_client.h"
13 namespace IPC {
14 class MessageFilter;
17 namespace network_hints {
18 class PrescientNetworkingDispatcher;
19 } // namespace network_hints
21 namespace chromecast {
22 namespace shell {
23 class CastRenderProcessObserver;
25 class CastContentRendererClient : public content::ContentRendererClient {
26 public:
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 // ContentRendererClient implementation:
37 void RenderThreadStarted() override;
38 void RenderViewCreated(content::RenderView* render_view) override;
39 void AddKeySystems(
40 std::vector< ::media::KeySystemInfo>* key_systems) override;
41 #if !defined(OS_ANDROID)
42 scoped_ptr<::media::RendererFactory> CreateMediaRendererFactory(
43 content::RenderFrame* render_frame,
44 const scoped_refptr<::media::GpuVideoAcceleratorFactories>& gpu_factories,
45 const scoped_refptr<::media::MediaLog>& media_log) override;
46 #endif
47 blink::WebPrescientNetworking* GetPrescientNetworking() override;
48 void DeferMediaLoad(content::RenderFrame* render_frame,
49 bool render_frame_has_played_media_before,
50 const base::Closure& closure) override;
52 protected:
53 CastContentRendererClient();
55 private:
56 scoped_ptr<network_hints::PrescientNetworkingDispatcher>
57 prescient_networking_dispatcher_;
58 scoped_ptr<CastRenderProcessObserver> cast_observer_;
59 const bool allow_hidden_media_playback_;
61 DISALLOW_COPY_AND_ASSIGN(CastContentRendererClient);
64 } // namespace shell
65 } // namespace chromecast
67 #endif // CHROMECAST_RENDERER_CAST_CONTENT_RENDERER_CLIENT_H_