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" |
| 10 #include "chromecast/common/cast_paths.h" |
| 11 #include "chromecast/common/global_descriptors.h" |
9 #include "chromecast/shell/browser/cast_browser_context.h" | 12 #include "chromecast/shell/browser/cast_browser_context.h" |
10 #include "chromecast/shell/browser/cast_browser_main_parts.h" | 13 #include "chromecast/shell/browser/cast_browser_main_parts.h" |
11 #include "chromecast/shell/browser/cast_browser_process.h" | 14 #include "chromecast/shell/browser/cast_browser_process.h" |
12 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" | 15 #include "chromecast/shell/browser/geolocation/cast_access_token_store.h" |
13 #include "chromecast/shell/browser/url_request_context_factory.h" | 16 #include "chromecast/shell/browser/url_request_context_factory.h" |
14 #include "content/public/browser/certificate_request_result_type.h" | 17 #include "content/public/browser/certificate_request_result_type.h" |
| 18 #include "content/public/browser/file_descriptor_info.h" |
15 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
16 #include "content/public/common/content_descriptors.h" | 20 #include "content/public/common/content_descriptors.h" |
17 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
18 #include "content/public/common/url_constants.h" | 22 #include "content/public/common/url_constants.h" |
19 #include "content/public/common/web_preferences.h" | 23 #include "content/public/common/web_preferences.h" |
20 | 24 |
21 namespace chromecast { | 25 namespace chromecast { |
22 namespace shell { | 26 namespace shell { |
23 | 27 |
24 CastContentBrowserClient::CastContentBrowserClient() | 28 CastContentBrowserClient::CastContentBrowserClient() |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 int opener_id, | 141 int opener_id, |
138 bool* no_javascript_access) { | 142 bool* no_javascript_access) { |
139 *no_javascript_access = true; | 143 *no_javascript_access = true; |
140 return false; | 144 return false; |
141 } | 145 } |
142 | 146 |
143 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 147 void CastContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
144 const base::CommandLine& command_line, | 148 const base::CommandLine& command_line, |
145 int child_process_id, | 149 int child_process_id, |
146 std::vector<content::FileDescriptorInfo>* mappings) { | 150 std::vector<content::FileDescriptorInfo>* mappings) { |
| 151 #if defined(OS_ANDROID) |
| 152 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ; |
| 153 base::FilePath pak_file; |
| 154 CHECK(PathService::Get(FILE_CAST_PAK, &pak_file)); |
| 155 base::File pak_with_flags(pak_file, flags); |
| 156 if (!pak_with_flags.IsValid()) { |
| 157 NOTREACHED() << "Failed to open file when creating renderer process: " |
| 158 << "cast_shell.pak"; |
| 159 } |
| 160 mappings->push_back(content::FileDescriptorInfo( |
| 161 kAndroidPakDescriptor, |
| 162 base::FileDescriptor(base::File(pak_file, flags)))); |
| 163 #endif // defined(OS_ANDROID) |
147 } | 164 } |
148 | 165 |
149 } // namespace shell | 166 } // namespace shell |
150 } // namespace chromecast | 167 } // namespace chromecast |
OLD | NEW |