| 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/shell/browser/cast_content_browser_client.h" | 5 #include "chromecast/shell/browser/cast_content_browser_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "chromecast/common/cast_paths.h" | 10 #include "chromecast/common/cast_paths.h" |
| 11 #include "chromecast/common/global_descriptors.h" | 11 #include "chromecast/common/global_descriptors.h" |
| 12 #include "chromecast/shell/browser/cast_browser_context.h" | 12 #include "chromecast/shell/browser/cast_browser_context.h" |
| 13 #include "chromecast/shell/browser/cast_browser_main_parts.h" | 13 #include "chromecast/shell/browser/cast_browser_main_parts.h" |
| 14 #include "chromecast/shell/browser/cast_browser_process.h" | 14 #include "chromecast/shell/browser/cast_browser_process.h" |
| 15 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" | 15 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" |
| 16 #include "chromecast/shell/browser/url_request_context_factory.h" | 16 #include "chromecast/shell/browser/url_request_context_factory.h" |
| 17 #include "content/public/browser/browser_thread.h" |
| 17 #include "content/public/browser/certificate_request_result_type.h" | 18 #include "content/public/browser/certificate_request_result_type.h" |
| 18 #include "content/public/browser/file_descriptor_info.h" | 19 #include "content/public/browser/file_descriptor_info.h" |
| 19 #include "content/public/browser/render_process_host.h" | 20 #include "content/public/browser/render_process_host.h" |
| 20 #include "content/public/common/content_descriptors.h" | 21 #include "content/public/common/content_descriptors.h" |
| 21 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 22 #include "content/public/common/url_constants.h" | 23 #include "content/public/common/url_constants.h" |
| 23 #include "content/public/common/web_preferences.h" | 24 #include "content/public/common/web_preferences.h" |
| 24 | 25 |
| 25 namespace chromecast { | 26 namespace chromecast { |
| 26 namespace shell { | 27 namespace shell { |
| 27 | 28 |
| 28 CastContentBrowserClient::CastContentBrowserClient() | 29 CastContentBrowserClient::CastContentBrowserClient() |
| 29 : url_request_context_factory_(new URLRequestContextFactory()) { | 30 : url_request_context_factory_(new URLRequestContextFactory()) { |
| 30 } | 31 } |
| 31 | 32 |
| 32 CastContentBrowserClient::~CastContentBrowserClient() { | 33 CastContentBrowserClient::~CastContentBrowserClient() { |
| 34 content::BrowserThread::DeleteSoon( |
| 35 content::BrowserThread::IO, |
| 36 FROM_HERE, |
| 37 url_request_context_factory_.release()); |
| 33 } | 38 } |
| 34 | 39 |
| 35 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( | 40 content::BrowserMainParts* CastContentBrowserClient::CreateBrowserMainParts( |
| 36 const content::MainFunctionParams& parameters) { | 41 const content::MainFunctionParams& parameters) { |
| 37 return new CastBrowserMainParts(parameters, | 42 return new CastBrowserMainParts(parameters, |
| 38 url_request_context_factory_.get()); | 43 url_request_context_factory_.get()); |
| 39 } | 44 } |
| 40 | 45 |
| 41 void CastContentBrowserClient::RenderProcessWillLaunch( | 46 void CastContentBrowserClient::RenderProcessWillLaunch( |
| 42 content::RenderProcessHost* host) { | 47 content::RenderProcessHost* host) { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 << "cast_shell.pak"; | 163 << "cast_shell.pak"; |
| 159 } | 164 } |
| 160 mappings->push_back(content::FileDescriptorInfo( | 165 mappings->push_back(content::FileDescriptorInfo( |
| 161 kAndroidPakDescriptor, | 166 kAndroidPakDescriptor, |
| 162 base::FileDescriptor(base::File(pak_file, flags)))); | 167 base::FileDescriptor(base::File(pak_file, flags)))); |
| 163 #endif // defined(OS_ANDROID) | 168 #endif // defined(OS_ANDROID) |
| 164 } | 169 } |
| 165 | 170 |
| 166 } // namespace shell | 171 } // namespace shell |
| 167 } // namespace chromecast | 172 } // namespace chromecast |
| OLD | NEW |