| 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 #include "chromecast/browser/cast_content_browser_client.h" | 5 #include "chromecast/browser/cast_content_browser_client.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/files/scoped_file.h" | 11 #include "base/files/scoped_file.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "chromecast/base/cast_paths.h" | 14 #include "chromecast/base/cast_paths.h" |
| 15 #include "chromecast/base/chromecast_switches.h" | 15 #include "chromecast/base/chromecast_switches.h" |
| 16 #include "chromecast/browser/cast_browser_context.h" | 16 #include "chromecast/browser/cast_browser_context.h" |
| 17 #include "chromecast/browser/cast_browser_main_parts.h" | 17 #include "chromecast/browser/cast_browser_main_parts.h" |
| 18 #include "chromecast/browser/cast_browser_process.h" | 18 #include "chromecast/browser/cast_browser_process.h" |
| 19 #include "chromecast/browser/cast_network_delegate.h" | 19 #include "chromecast/browser/cast_network_delegate.h" |
| 20 #include "chromecast/browser/cast_quota_permission_context.h" | 20 #include "chromecast/browser/cast_quota_permission_context.h" |
| 21 #include "chromecast/browser/cast_resource_dispatcher_host_delegate.h" | 21 #include "chromecast/browser/cast_resource_dispatcher_host_delegate.h" |
| 22 #include "chromecast/browser/geolocation/cast_access_token_store.h" | 22 #include "chromecast/browser/geolocation/cast_access_token_store.h" |
| 23 #include "chromecast/browser/media/cma_message_filter_host.h" | 23 #include "chromecast/browser/media/cma_message_filter_host.h" |
| 24 #include "chromecast/browser/url_request_context_factory.h" | 24 #include "chromecast/browser/url_request_context_factory.h" |
| 25 #include "chromecast/common/global_descriptors.h" | 25 #include "chromecast/common/global_descriptors.h" |
| 26 #include "chromecast/media/audio/cast_audio_manager_factory.h" |
| 26 #include "chromecast/media/cma/backend/media_pipeline_device.h" | 27 #include "chromecast/media/cma/backend/media_pipeline_device.h" |
| 27 #include "chromecast/media/cma/backend/media_pipeline_device_factory.h" | 28 #include "chromecast/media/cma/backend/media_pipeline_device_factory.h" |
| 28 #include "components/crash/app/breakpad_linux.h" | 29 #include "components/crash/app/breakpad_linux.h" |
| 29 #include "components/crash/browser/crash_handler_host_linux.h" | 30 #include "components/crash/browser/crash_handler_host_linux.h" |
| 30 #include "components/network_hints/browser/network_hints_message_filter.h" | 31 #include "components/network_hints/browser/network_hints_message_filter.h" |
| 31 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 32 #include "content/public/browser/certificate_request_result_type.h" | 33 #include "content/public/browser/certificate_request_result_type.h" |
| 33 #include "content/public/browser/client_certificate_delegate.h" | 34 #include "content/public/browser/client_certificate_delegate.h" |
| 34 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
| 35 #include "content/public/browser/resource_dispatcher_host.h" | 36 #include "content/public/browser/resource_dispatcher_host.h" |
| 36 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
| 37 #include "content/public/common/content_descriptors.h" | 38 #include "content/public/common/content_descriptors.h" |
| 38 #include "content/public/common/content_switches.h" | 39 #include "content/public/common/content_switches.h" |
| 39 #include "content/public/common/url_constants.h" | 40 #include "content/public/common/url_constants.h" |
| 40 #include "content/public/common/web_preferences.h" | 41 #include "content/public/common/web_preferences.h" |
| 41 #include "media/audio/audio_manager_factory.h" | |
| 42 #include "net/ssl/ssl_cert_request_info.h" | 42 #include "net/ssl/ssl_cert_request_info.h" |
| 43 #include "net/url_request/url_request_context_getter.h" | 43 #include "net/url_request/url_request_context_getter.h" |
| 44 #include "ui/gl/gl_switches.h" | 44 #include "ui/gl/gl_switches.h" |
| 45 | 45 |
| 46 #if defined(OS_ANDROID) | 46 #if defined(OS_ANDROID) |
| 47 #include "components/crash/browser/crash_dump_manager_android.h" | 47 #include "components/crash/browser/crash_dump_manager_android.h" |
| 48 #include "components/external_video_surface/browser/android/external_video_surfa
ce_container_impl.h" | 48 #include "components/external_video_surface/browser/android/external_video_surfa
ce_container_impl.h" |
| 49 #endif // defined(OS_ANDROID) | 49 #endif // defined(OS_ANDROID) |
| 50 | 50 |
| 51 namespace chromecast { | 51 namespace chromecast { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 64 | 64 |
| 65 void CastContentBrowserClient::AppendExtraCommandLineSwitches( | 65 void CastContentBrowserClient::AppendExtraCommandLineSwitches( |
| 66 base::CommandLine* command_line) { | 66 base::CommandLine* command_line) { |
| 67 } | 67 } |
| 68 | 68 |
| 69 std::vector<scoped_refptr<content::BrowserMessageFilter>> | 69 std::vector<scoped_refptr<content::BrowserMessageFilter>> |
| 70 CastContentBrowserClient::GetBrowserMessageFilters() { | 70 CastContentBrowserClient::GetBrowserMessageFilters() { |
| 71 return std::vector<scoped_refptr<content::BrowserMessageFilter>>(); | 71 return std::vector<scoped_refptr<content::BrowserMessageFilter>>(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 scoped_ptr<::media::AudioManagerFactory> | |
| 75 CastContentBrowserClient::CreateAudioManagerFactory() { | |
| 76 // Return nullptr. The factory will not be set, and the statically linked | |
| 77 // implementation of AudioManager will be used. | |
| 78 return scoped_ptr<::media::AudioManagerFactory>(); | |
| 79 } | |
| 80 | |
| 81 #if !defined(OS_ANDROID) | 74 #if !defined(OS_ANDROID) |
| 82 scoped_ptr<media::MediaPipelineDevice> | 75 scoped_ptr<media::MediaPipelineDevice> |
| 83 CastContentBrowserClient::CreateMediaPipelineDevice( | 76 CastContentBrowserClient::CreateMediaPipelineDevice( |
| 84 const media::MediaPipelineDeviceParams& params) { | 77 const media::MediaPipelineDeviceParams& params) { |
| 85 scoped_ptr<media::MediaPipelineDeviceFactory> factory = | 78 scoped_ptr<media::MediaPipelineDeviceFactory> factory = |
| 86 GetMediaPipelineDeviceFactory(params); | 79 GetMediaPipelineDeviceFactory(params); |
| 87 return make_scoped_ptr(new media::MediaPipelineDevice(factory.Pass())); | 80 return make_scoped_ptr(new media::MediaPipelineDevice(factory.Pass())); |
| 88 } | 81 } |
| 89 #endif | 82 #endif |
| 90 | 83 |
| 91 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( | 84 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( |
| 92 const content::MainFunctionParams& parameters) { | 85 const content::MainFunctionParams& parameters) { |
| 93 return new CastBrowserMainParts(parameters, | 86 return new CastBrowserMainParts( |
| 94 url_request_context_factory_.get(), | 87 parameters, |
| 95 CreateAudioManagerFactory()); | 88 url_request_context_factory_.get(), |
| 89 make_scoped_ptr(new chromecast::media::CastAudioManagerFactory())); |
| 96 } | 90 } |
| 97 | 91 |
| 98 void CastContentBrowserClient::RenderProcessWillLaunch( | 92 void CastContentBrowserClient::RenderProcessWillLaunch( |
| 99 content::RenderProcessHost* host) { | 93 content::RenderProcessHost* host) { |
| 100 #if !defined(OS_ANDROID) | 94 #if !defined(OS_ANDROID) |
| 101 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( | 95 scoped_refptr<media::CmaMessageFilterHost> cma_message_filter( |
| 102 new media::CmaMessageFilterHost( | 96 new media::CmaMessageFilterHost( |
| 103 host->GetID(), | 97 host->GetID(), |
| 104 base::Bind( | 98 base::Bind( |
| 105 &CastContentBrowserClient::CreateMediaPipelineDevice, | 99 &CastContentBrowserClient::CreateMediaPipelineDevice, |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 process_type, dumps_path, false /* upload */); | 416 process_type, dumps_path, false /* upload */); |
| 423 // StartUploaderThread() even though upload is diferred. | 417 // StartUploaderThread() even though upload is diferred. |
| 424 // Breakpad-related memory is freed in the uploader thread. | 418 // Breakpad-related memory is freed in the uploader thread. |
| 425 crash_handler->StartUploaderThread(); | 419 crash_handler->StartUploaderThread(); |
| 426 return crash_handler; | 420 return crash_handler; |
| 427 } | 421 } |
| 428 #endif // !defined(OS_ANDROID) | 422 #endif // !defined(OS_ANDROID) |
| 429 | 423 |
| 430 } // namespace shell | 424 } // namespace shell |
| 431 } // namespace chromecast | 425 } // namespace chromecast |
| OLD | NEW |