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_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
6 #define CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 6 #define CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "content/public/browser/content_browser_client.h" | 14 #include "content/public/browser/content_browser_client.h" |
15 | 15 |
| 16 class PrefService; |
| 17 |
16 namespace breakpad { | 18 namespace breakpad { |
17 class CrashHandlerHostLinux; | 19 class CrashHandlerHostLinux; |
18 } | 20 } |
19 | 21 |
20 namespace content { | |
21 class BrowserMessageFilter; | |
22 } | |
23 | |
24 namespace media { | 22 namespace media { |
25 class AudioManagerFactory; | 23 class AudioManagerFactory; |
26 } | 24 } |
27 | 25 |
28 namespace metrics { | 26 namespace metrics { |
29 class MetricsService; | 27 class MetricsService; |
30 } | 28 } |
31 | 29 |
32 namespace chromecast { | 30 namespace chromecast { |
| 31 class CastService; |
| 32 |
33 namespace media { | 33 namespace media { |
34 class MediaPipelineBackend; | 34 class MediaPipelineBackend; |
35 struct MediaPipelineDeviceParams; | 35 struct MediaPipelineDeviceParams; |
36 } | 36 } |
37 | 37 |
38 namespace shell { | 38 namespace shell { |
39 | 39 |
40 class CastBrowserMainParts; | 40 class CastBrowserMainParts; |
41 class URLRequestContextFactory; | 41 class URLRequestContextFactory; |
42 | 42 |
43 class CastContentBrowserClient : public content::ContentBrowserClient { | 43 class CastContentBrowserClient : public content::ContentBrowserClient { |
44 public: | 44 public: |
45 // Creates an implementation of CastContentBrowserClient. Platform should | 45 // Creates an implementation of CastContentBrowserClient. Platform should |
46 // link in an implementation as needed. | 46 // link in an implementation as needed. |
47 static scoped_ptr<CastContentBrowserClient> Create(); | 47 static scoped_ptr<CastContentBrowserClient> Create(); |
48 | 48 |
49 ~CastContentBrowserClient() override; | 49 ~CastContentBrowserClient() override; |
50 | 50 |
51 // Appends extra command line arguments before launching a new process. | 51 // Appends extra command line arguments before launching a new process. |
52 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line); | 52 virtual void AppendExtraCommandLineSwitches(base::CommandLine* command_line); |
53 | 53 |
54 // Returns any BrowserMessageFilters that should be added when launching a | 54 // Creates and returns the CastService instance for the current process. |
55 // new render process. | 55 // Note: |request_context_getter| might be different than the main request |
56 virtual std::vector<scoped_refptr<content::BrowserMessageFilter>> | 56 // getter accessible via CastBrowserProcess. |
57 GetBrowserMessageFilters(); | 57 virtual scoped_ptr<CastService> CreateCastService( |
| 58 content::BrowserContext* browser_context, |
| 59 PrefService* pref_service, |
| 60 net::URLRequestContextGetter* request_context_getter); |
58 | 61 |
59 // Provide an AudioManagerFactory instance for WebAudio playback. | 62 // Provide an AudioManagerFactory instance for WebAudio playback. |
60 virtual scoped_ptr<::media::AudioManagerFactory> CreateAudioManagerFactory(); | 63 virtual scoped_ptr<::media::AudioManagerFactory> CreateAudioManagerFactory(); |
61 | 64 |
62 #if !defined(OS_ANDROID) | 65 #if !defined(OS_ANDROID) |
63 // Creates a MediaPipelineDevice (CMA backend) for media playback, called | 66 // Creates a MediaPipelineDevice (CMA backend) for media playback, called |
64 // once per media player instance. | 67 // once per media player instance. |
65 virtual scoped_ptr<media::MediaPipelineBackend> CreateMediaPipelineBackend( | 68 virtual scoped_ptr<media::MediaPipelineBackend> CreateMediaPipelineBackend( |
66 const media::MediaPipelineDeviceParams& params); | 69 const media::MediaPipelineDeviceParams& params); |
67 #endif | 70 #endif |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 174 |
172 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; | 175 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; |
173 | 176 |
174 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); | 177 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); |
175 }; | 178 }; |
176 | 179 |
177 } // namespace shell | 180 } // namespace shell |
178 } // namespace chromecast | 181 } // namespace chromecast |
179 | 182 |
180 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 183 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |