| 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 namespace breakpad { | 16 namespace breakpad { |
| 17 class CrashHandlerHostLinux; | 17 class CrashHandlerHostLinux; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 class BrowserMessageFilter; | 21 class BrowserMessageFilter; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace media { | 24 namespace media { |
| 25 class AudioManagerFactory; | 25 class AudioManagerFactory; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace net { | 28 namespace metrics { |
| 29 class HostResolver; | 29 class MetricsService; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace chromecast { | 32 namespace chromecast { |
| 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 // Returns any BrowserMessageFilters that should be added when launching a |
| 55 // new render process. | 55 // new render process. |
| 56 virtual std::vector<scoped_refptr<content::BrowserMessageFilter>> | 56 virtual std::vector<scoped_refptr<content::BrowserMessageFilter>> |
| 57 GetBrowserMessageFilters(); | 57 GetBrowserMessageFilters(); |
| 58 | 58 |
| 59 // Provide an AudioManagerFactory instance for WebAudio playback. | 59 // Provide an AudioManagerFactory instance for WebAudio playback. |
| 60 virtual scoped_ptr<::media::AudioManagerFactory> CreateAudioManagerFactory(); | 60 virtual scoped_ptr<::media::AudioManagerFactory> CreateAudioManagerFactory(); |
| 61 | 61 |
| 62 #if !defined(OS_ANDROID) | 62 #if !defined(OS_ANDROID) |
| 63 // Creates a MediaPipelineDevice (CMA backend) for media playback, called | 63 // Creates a MediaPipelineDevice (CMA backend) for media playback, called |
| 64 // once per media player instance. | 64 // once per media player instance. |
| 65 virtual scoped_ptr<media::MediaPipelineBackend> CreateMediaPipelineBackend( | 65 virtual scoped_ptr<media::MediaPipelineBackend> CreateMediaPipelineBackend( |
| 66 const media::MediaPipelineDeviceParams& params); | 66 const media::MediaPipelineDeviceParams& params); |
| 67 #endif | 67 #endif |
| 68 | 68 |
| 69 // Invoked when the metrics client ID changes. |
| 70 virtual void SetMetricsClientId(const std::string& client_id); |
| 71 |
| 72 // Allows registration of extra metrics providers. |
| 73 virtual void RegisterMetricsProviders( |
| 74 ::metrics::MetricsService* metrics_service); |
| 75 |
| 69 // content::ContentBrowserClient implementation: | 76 // content::ContentBrowserClient implementation: |
| 70 content::BrowserMainParts* CreateBrowserMainParts( | 77 content::BrowserMainParts* CreateBrowserMainParts( |
| 71 const content::MainFunctionParams& parameters) override; | 78 const content::MainFunctionParams& parameters) override; |
| 72 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; | 79 void RenderProcessWillLaunch(content::RenderProcessHost* host) override; |
| 73 net::URLRequestContextGetter* CreateRequestContext( | 80 net::URLRequestContextGetter* CreateRequestContext( |
| 74 content::BrowserContext* browser_context, | 81 content::BrowserContext* browser_context, |
| 75 content::ProtocolHandlerMap* protocol_handlers, | 82 content::ProtocolHandlerMap* protocol_handlers, |
| 76 content::URLRequestInterceptorScopedVector request_interceptors) | 83 content::URLRequestInterceptorScopedVector request_interceptors) |
| 77 override; | 84 override; |
| 78 bool IsHandledURL(const GURL& url) override; | 85 bool IsHandledURL(const GURL& url) override; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 168 |
| 162 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; | 169 scoped_ptr<URLRequestContextFactory> url_request_context_factory_; |
| 163 | 170 |
| 164 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); | 171 DISALLOW_COPY_AND_ASSIGN(CastContentBrowserClient); |
| 165 }; | 172 }; |
| 166 | 173 |
| 167 } // namespace shell | 174 } // namespace shell |
| 168 } // namespace chromecast | 175 } // namespace chromecast |
| 169 | 176 |
| 170 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ | 177 #endif // CHROMECAST_BROWSER_CAST_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |