| 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 #include "chrome/browser/ui/chrome_select_file_policy.h" | 86 #include "chrome/browser/ui/chrome_select_file_policy.h" |
| 87 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 87 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 88 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" | 88 #include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
| 89 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 89 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
| 90 #include "chrome/browser/user_style_sheet_watcher.h" | 90 #include "chrome/browser/user_style_sheet_watcher.h" |
| 91 #include "chrome/browser/user_style_sheet_watcher_factory.h" | 91 #include "chrome/browser/user_style_sheet_watcher_factory.h" |
| 92 #include "chrome/browser/validation_message_message_filter.h" | 92 #include "chrome/browser/validation_message_message_filter.h" |
| 93 #include "chrome/common/chrome_constants.h" | 93 #include "chrome/common/chrome_constants.h" |
| 94 #include "chrome/common/chrome_paths.h" | 94 #include "chrome/common/chrome_paths.h" |
| 95 #include "chrome/common/chrome_switches.h" | 95 #include "chrome/common/chrome_switches.h" |
| 96 #include "chrome/common/env_vars.h" |
| 96 #include "chrome/common/extensions/background_info.h" | 97 #include "chrome/common/extensions/background_info.h" |
| 97 #include "chrome/common/extensions/extension.h" | 98 #include "chrome/common/extensions/extension.h" |
| 98 #include "chrome/common/extensions/extension_process_policy.h" | 99 #include "chrome/common/extensions/extension_process_policy.h" |
| 99 #include "chrome/common/extensions/extension_set.h" | 100 #include "chrome/common/extensions/extension_set.h" |
| 100 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" | 101 #include "chrome/common/extensions/manifest_handlers/app_isolation_info.h" |
| 101 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" | 102 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" |
| 102 #include "chrome/common/extensions/permissions/permissions_data.h" | 103 #include "chrome/common/extensions/permissions/permissions_data.h" |
| 103 #include "chrome/common/extensions/permissions/socket_permission.h" | 104 #include "chrome/common/extensions/permissions/socket_permission.h" |
| 104 #include "chrome/common/extensions/web_accessible_resources_handler.h" | 105 #include "chrome/common/extensions/web_accessible_resources_handler.h" |
| 105 #include "chrome/common/logging_chrome.h" | 106 #include "chrome/common/logging_chrome.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 #include "chrome/browser/android/crash_dump_manager.h" | 167 #include "chrome/browser/android/crash_dump_manager.h" |
| 167 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" | 168 #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" |
| 168 #include "chrome/browser/chrome_browser_main_android.h" | 169 #include "chrome/browser/chrome_browser_main_android.h" |
| 169 #include "chrome/browser/media/encrypted_media_message_filter_android.h" | 170 #include "chrome/browser/media/encrypted_media_message_filter_android.h" |
| 170 #include "chrome/common/descriptors_android.h" | 171 #include "chrome/common/descriptors_android.h" |
| 171 #elif defined(OS_POSIX) | 172 #elif defined(OS_POSIX) |
| 172 #include "chrome/browser/chrome_browser_main_posix.h" | 173 #include "chrome/browser/chrome_browser_main_posix.h" |
| 173 #endif | 174 #endif |
| 174 | 175 |
| 175 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 176 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 177 #include "base/debug/leak_annotations.h" |
| 176 #include "base/linux_util.h" | 178 #include "base/linux_util.h" |
| 177 #include "chrome/app/breakpad_linux.h" | 179 #include "chrome/app/breakpad_linux.h" |
| 178 #include "chrome/browser/crash_handler_host_linux.h" | 180 #include "chrome/browser/crash_handler_host_linux.h" |
| 179 #endif | 181 #endif |
| 180 | 182 |
| 181 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) | 183 #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) |
| 182 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" | 184 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" |
| 183 #endif | 185 #endif |
| 184 | 186 |
| 185 #if defined(OS_ANDROID) | 187 #if defined(OS_ANDROID) |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { | 488 for (size_t i = 0; i < prefs::kWebKitScriptsForFontFamilyMapsLength; ++i) { |
| 487 const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; | 489 const char* script = prefs::kWebKitScriptsForFontFamilyMaps[i]; |
| 488 std::string pref_name = base::StringPrintf("%s.%s", map_name, script); | 490 std::string pref_name = base::StringPrintf("%s.%s", map_name, script); |
| 489 std::string font_family = prefs->GetString(pref_name.c_str()); | 491 std::string font_family = prefs->GetString(pref_name.c_str()); |
| 490 if (!font_family.empty()) | 492 if (!font_family.empty()) |
| 491 (*map)[script] = UTF8ToUTF16(font_family); | 493 (*map)[script] = UTF8ToUTF16(font_family); |
| 492 } | 494 } |
| 493 } | 495 } |
| 494 | 496 |
| 495 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 497 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 498 CrashHandlerHostLinux* CreateCrashHandlerHost(const std::string& process_type) { |
| 499 base::FilePath dumps_path; |
| 500 PathService::Get(chrome::DIR_CRASH_DUMPS, &dumps_path); |
| 501 { |
| 502 ANNOTATE_SCOPED_MEMORY_LEAK; |
| 503 CrashHandlerHostLinux* crash_handler = new CrashHandlerHostLinux( |
| 504 process_type, dumps_path, getenv(env_vars::kHeadless) == NULL); |
| 505 crash_handler->StartUploaderThread(); |
| 506 return crash_handler; |
| 507 } |
| 508 } |
| 509 |
| 496 int GetCrashSignalFD(const CommandLine& command_line) { | 510 int GetCrashSignalFD(const CommandLine& command_line) { |
| 497 if (command_line.HasSwitch(switches::kExtensionProcess)) { | 511 if (command_line.HasSwitch(switches::kExtensionProcess)) { |
| 498 ExtensionCrashHandlerHostLinux* crash_handler = | 512 static CrashHandlerHostLinux* crash_handler = NULL; |
| 499 ExtensionCrashHandlerHostLinux::GetInstance(); | 513 if (!crash_handler) |
| 514 crash_handler = CreateCrashHandlerHost("extension"); |
| 500 return crash_handler->GetDeathSignalSocket(); | 515 return crash_handler->GetDeathSignalSocket(); |
| 501 } | 516 } |
| 502 | 517 |
| 503 std::string process_type = | 518 std::string process_type = |
| 504 command_line.GetSwitchValueASCII(switches::kProcessType); | 519 command_line.GetSwitchValueASCII(switches::kProcessType); |
| 505 | 520 |
| 506 if (process_type == switches::kRendererProcess) | 521 if (process_type == switches::kRendererProcess) { |
| 507 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 522 static CrashHandlerHostLinux* crash_handler = NULL; |
| 523 if (!crash_handler) |
| 524 crash_handler = CreateCrashHandlerHost(process_type); |
| 525 return crash_handler->GetDeathSignalSocket(); |
| 526 } |
| 508 | 527 |
| 509 if (process_type == switches::kPluginProcess) | 528 if (process_type == switches::kPluginProcess) { |
| 510 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 529 static CrashHandlerHostLinux* crash_handler = NULL; |
| 530 if (!crash_handler) |
| 531 crash_handler = CreateCrashHandlerHost(process_type); |
| 532 return crash_handler->GetDeathSignalSocket(); |
| 533 } |
| 511 | 534 |
| 512 if (process_type == switches::kPpapiPluginProcess) | 535 if (process_type == switches::kPpapiPluginProcess) { |
| 513 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 536 static CrashHandlerHostLinux* crash_handler = NULL; |
| 537 if (!crash_handler) |
| 538 crash_handler = CreateCrashHandlerHost(process_type); |
| 539 return crash_handler->GetDeathSignalSocket(); |
| 540 } |
| 514 | 541 |
| 515 if (process_type == switches::kGpuProcess) | 542 if (process_type == switches::kGpuProcess) { |
| 516 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 543 static CrashHandlerHostLinux* crash_handler = NULL; |
| 544 if (!crash_handler) |
| 545 crash_handler = CreateCrashHandlerHost(process_type); |
| 546 return crash_handler->GetDeathSignalSocket(); |
| 547 } |
| 517 | 548 |
| 518 return -1; | 549 return -1; |
| 519 } | 550 } |
| 520 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | 551 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
| 521 | 552 |
| 522 #if !defined(OS_CHROMEOS) | 553 #if !defined(OS_CHROMEOS) |
| 523 GURL GetEffectiveURLForSignin(const GURL& url) { | 554 GURL GetEffectiveURLForSignin(const GURL& url) { |
| 524 CHECK(SigninManager::IsWebBasedSigninFlowURL(url)); | 555 CHECK(SigninManager::IsWebBasedSigninFlowURL(url)); |
| 525 | 556 |
| 526 GURL effective_url(SigninManager::kChromeSigninEffectiveSite); | 557 GURL effective_url(SigninManager::kChromeSigninEffectiveSite); |
| (...skipping 2052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2579 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, | 2610 return IsExtensionOrSharedModuleWhitelisted(url, extension_set, |
| 2580 allowed_file_handle_origins_) || | 2611 allowed_file_handle_origins_) || |
| 2581 IsHostAllowedByCommandLine(url, extension_set, | 2612 IsHostAllowedByCommandLine(url, extension_set, |
| 2582 switches::kAllowNaClFileHandleAPI); | 2613 switches::kAllowNaClFileHandleAPI); |
| 2583 #else | 2614 #else |
| 2584 return false; | 2615 return false; |
| 2585 #endif | 2616 #endif |
| 2586 } | 2617 } |
| 2587 | 2618 |
| 2588 } // namespace chrome | 2619 } // namespace chrome |
| OLD | NEW |