OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 #endif | 195 #endif |
196 | 196 |
197 #if defined(ENABLE_INPUT_SPEECH) | 197 #if defined(ENABLE_INPUT_SPEECH) |
198 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate_bubbl
e_ui.h" | 198 #include "chrome/browser/speech/chrome_speech_recognition_manager_delegate_bubbl
e_ui.h" |
199 #endif | 199 #endif |
200 | 200 |
201 #if defined(FILE_MANAGER_EXTENSION) | 201 #if defined(FILE_MANAGER_EXTENSION) |
202 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" | 202 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" |
203 #endif | 203 #endif |
204 | 204 |
| 205 #if defined(ENABLE_IPC_FUZZER) |
| 206 #include "chrome/browser/ipc_fuzzer_host.h" |
| 207 #endif |
| 208 |
205 using base::FileDescriptor; | 209 using base::FileDescriptor; |
206 using content::AccessTokenStore; | 210 using content::AccessTokenStore; |
207 using content::BrowserChildProcessHostIterator; | 211 using content::BrowserChildProcessHostIterator; |
208 using content::BrowserThread; | 212 using content::BrowserThread; |
209 using content::BrowserURLHandler; | 213 using content::BrowserURLHandler; |
210 using content::ChildProcessSecurityPolicy; | 214 using content::ChildProcessSecurityPolicy; |
211 using content::FileDescriptorInfo; | 215 using content::FileDescriptorInfo; |
212 using content::QuotaPermissionContext; | 216 using content::QuotaPermissionContext; |
213 using content::RenderViewHost; | 217 using content::RenderViewHost; |
214 using content::SiteInstance; | 218 using content::SiteInstance; |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 #endif | 823 #endif |
820 | 824 |
821 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 825 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
822 profile->IsOffTheRecord())); | 826 profile->IsOffTheRecord())); |
823 | 827 |
824 host->Send(new ChromeViewMsg_SetExtensionActivityLogEnabled( | 828 host->Send(new ChromeViewMsg_SetExtensionActivityLogEnabled( |
825 IsExtensionActivityLogEnabledForProfile(profile))); | 829 IsExtensionActivityLogEnabledForProfile(profile))); |
826 | 830 |
827 SendExtensionWebRequestStatusToHost(host); | 831 SendExtensionWebRequestStatusToHost(host); |
828 | 832 |
| 833 #if defined(ENABLE_IPC_FUZZER) |
| 834 SendTestcaseToIpcFuzzer(host); |
| 835 #endif |
| 836 |
829 RendererContentSettingRules rules; | 837 RendererContentSettingRules rules; |
830 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 838 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
831 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 839 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
832 } | 840 } |
833 | 841 |
834 GURL ChromeContentBrowserClient::GetPossiblyPrivilegedURL( | 842 GURL ChromeContentBrowserClient::GetPossiblyPrivilegedURL( |
835 content::BrowserContext* browser_context, | 843 content::BrowserContext* browser_context, |
836 const GURL& url, | 844 const GURL& url, |
837 bool is_renderer_initiated, | 845 bool is_renderer_initiated, |
838 content::SiteInstance* current_instance) { | 846 content::SiteInstance* current_instance) { |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | 1297 const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); |
1290 | 1298 |
1291 if (browser_command_line.HasSwitch(switches::kChromeFrame)) | 1299 if (browser_command_line.HasSwitch(switches::kChromeFrame)) |
1292 command_line->AppendSwitch(switches::kChromeFrame); | 1300 command_line->AppendSwitch(switches::kChromeFrame); |
1293 | 1301 |
1294 if (process_type == switches::kRendererProcess) { | 1302 if (process_type == switches::kRendererProcess) { |
1295 base::FilePath user_data_dir = | 1303 base::FilePath user_data_dir = |
1296 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); | 1304 browser_command_line.GetSwitchValuePath(switches::kUserDataDir); |
1297 if (!user_data_dir.empty()) | 1305 if (!user_data_dir.empty()) |
1298 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); | 1306 command_line->AppendSwitchPath(switches::kUserDataDir, user_data_dir); |
| 1307 |
| 1308 #if defined(ENABLE_IPC_FUZZER) |
| 1309 if (browser_command_line.HasSwitch(switches::kIpcFuzzerTestcase)) |
| 1310 command_line->AppendSwitch(switches::kIpcFuzzerOverride); |
| 1311 #endif |
| 1312 |
1299 #if defined(OS_CHROMEOS) | 1313 #if defined(OS_CHROMEOS) |
1300 const std::string& login_profile = | 1314 const std::string& login_profile = |
1301 browser_command_line.GetSwitchValueASCII( | 1315 browser_command_line.GetSwitchValueASCII( |
1302 chromeos::switches::kLoginProfile); | 1316 chromeos::switches::kLoginProfile); |
1303 if (!login_profile.empty()) | 1317 if (!login_profile.empty()) |
1304 command_line->AppendSwitchASCII( | 1318 command_line->AppendSwitchASCII( |
1305 chromeos::switches::kLoginProfile, login_profile); | 1319 chromeos::switches::kLoginProfile, login_profile); |
1306 #endif | 1320 #endif |
1307 | 1321 |
1308 content::RenderProcessHost* process = | 1322 content::RenderProcessHost* process = |
(...skipping 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2324 new drive::FileSystemBackendDelegate(external_mount_points), | 2338 new drive::FileSystemBackendDelegate(external_mount_points), |
2325 special_storage_policy, | 2339 special_storage_policy, |
2326 external_mount_points, | 2340 external_mount_points, |
2327 fileapi::ExternalMountPoints::GetSystemInstance()); | 2341 fileapi::ExternalMountPoints::GetSystemInstance()); |
2328 backend->AddSystemMountPoints(); | 2342 backend->AddSystemMountPoints(); |
2329 DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); | 2343 DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); |
2330 additional_backends->push_back(backend); | 2344 additional_backends->push_back(backend); |
2331 #endif | 2345 #endif |
2332 } | 2346 } |
2333 | 2347 |
| 2348 bool ChromeContentBrowserClient::ShouldKillChildProcessOnBadMessage() { |
| 2349 #if defined(ENABLE_IPC_FUZZER) |
| 2350 // Don't kill the IPC fuzzer process, if it sends a bad message. |
| 2351 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kIpcFuzzerTestcase)) |
| 2352 return false; |
| 2353 #endif |
| 2354 |
| 2355 return true; |
| 2356 } |
| 2357 |
2334 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 2358 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
2335 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 2359 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
2336 const CommandLine& command_line, | 2360 const CommandLine& command_line, |
2337 int child_process_id, | 2361 int child_process_id, |
2338 std::vector<FileDescriptorInfo>* mappings) { | 2362 std::vector<FileDescriptorInfo>* mappings) { |
2339 #if defined(OS_ANDROID) | 2363 #if defined(OS_ANDROID) |
2340 base::FilePath data_path; | 2364 base::FilePath data_path; |
2341 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); | 2365 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
2342 DCHECK(!data_path.empty()); | 2366 DCHECK(!data_path.empty()); |
2343 | 2367 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2431 #if defined(USE_NSS) | 2455 #if defined(USE_NSS) |
2432 crypto::CryptoModuleBlockingPasswordDelegate* | 2456 crypto::CryptoModuleBlockingPasswordDelegate* |
2433 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 2457 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
2434 const GURL& url) { | 2458 const GURL& url) { |
2435 return chrome::NewCryptoModuleBlockingDialogDelegate( | 2459 return chrome::NewCryptoModuleBlockingDialogDelegate( |
2436 chrome::kCryptoModulePasswordKeygen, url.host()); | 2460 chrome::kCryptoModulePasswordKeygen, url.host()); |
2437 } | 2461 } |
2438 #endif | 2462 #endif |
2439 | 2463 |
2440 } // namespace chrome | 2464 } // namespace chrome |
OLD | NEW |