OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
9 #include "chrome/browser/browser_about_handler.h" | 9 #include "chrome/browser/browser_about_handler.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "net/base/cookie_options.h" | 75 #include "net/base/cookie_options.h" |
76 #include "ui/base/l10n/l10n_util.h" | 76 #include "ui/base/l10n/l10n_util.h" |
77 #include "ui/base/resource/resource_bundle.h" | 77 #include "ui/base/resource/resource_bundle.h" |
78 | 78 |
79 #if defined(OS_WIN) | 79 #if defined(OS_WIN) |
80 #include "chrome/browser/chrome_browser_main_win.h" | 80 #include "chrome/browser/chrome_browser_main_win.h" |
81 #elif defined(OS_MACOSX) | 81 #elif defined(OS_MACOSX) |
82 #include "chrome/browser/chrome_browser_main_mac.h" | 82 #include "chrome/browser/chrome_browser_main_mac.h" |
83 #elif defined(OS_CHROMEOS) | 83 #elif defined(OS_CHROMEOS) |
84 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" | 84 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" |
85 #elif defined(OS_LINUX) | 85 #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
86 #include "chrome/browser/chrome_browser_main_linux.h" | 86 #include "chrome/browser/chrome_browser_main_linux.h" |
87 #elif defined(OS_POSIX) | 87 #elif defined(OS_POSIX) |
88 #include "chrome/browser/chrome_browser_main_posix.h" | 88 #include "chrome/browser/chrome_browser_main_posix.h" |
89 #endif | 89 #endif |
90 | 90 |
91 #if defined(USE_AURA) | 91 #if defined(USE_AURA) |
92 #include "chrome/browser/chrome_browser_parts_aura.h" | 92 #include "chrome/browser/chrome_browser_parts_aura.h" |
93 #endif | 93 #endif |
94 | 94 |
95 #if defined(TOOLKIT_USES_GTK) | 95 #if defined(TOOLKIT_USES_GTK) |
96 #include "chrome/browser/chrome_browser_parts_gtk.h" | 96 #include "chrome/browser/chrome_browser_parts_gtk.h" |
97 #endif | 97 #endif |
98 | 98 |
99 #if defined(OS_LINUX) | 99 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
100 #include "base/linux_util.h" | 100 #include "base/linux_util.h" |
101 #include "chrome/browser/crash_handler_host_linux.h" | 101 #include "chrome/browser/crash_handler_host_linux.h" |
102 #endif | 102 #endif |
103 | 103 |
104 #if defined(TOOLKIT_VIEWS) | 104 #if defined(TOOLKIT_VIEWS) |
105 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 105 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
106 #elif defined(TOOLKIT_USES_GTK) | 106 #elif defined(TOOLKIT_USES_GTK) |
107 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" | 107 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" |
108 #elif defined(OS_MACOSX) | 108 #elif defined(OS_MACOSX) |
109 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" | 109 #include "chrome/browser/tab_contents/tab_contents_view_mac.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 void ChromeContentBrowserClient::CreateBrowserMainParts( | 202 void ChromeContentBrowserClient::CreateBrowserMainParts( |
203 const MainFunctionParams& parameters, | 203 const MainFunctionParams& parameters, |
204 std::vector<content::BrowserMainParts*>* parts_list) { | 204 std::vector<content::BrowserMainParts*>* parts_list) { |
205 // Construct the Main browser parts based on the OS type. | 205 // Construct the Main browser parts based on the OS type. |
206 #if defined(OS_WIN) | 206 #if defined(OS_WIN) |
207 parts_list->push_back(new ChromeBrowserMainPartsWin(parameters)); | 207 parts_list->push_back(new ChromeBrowserMainPartsWin(parameters)); |
208 #elif defined(OS_MACOSX) | 208 #elif defined(OS_MACOSX) |
209 parts_list->push_back(new ChromeBrowserMainPartsMac(parameters)); | 209 parts_list->push_back(new ChromeBrowserMainPartsMac(parameters)); |
210 #elif defined(OS_CHROMEOS) | 210 #elif defined(OS_CHROMEOS) |
211 parts_list->push_back(new ChromeBrowserMainPartsChromeos(parameters)); | 211 parts_list->push_back(new ChromeBrowserMainPartsChromeos(parameters)); |
212 #elif defined(OS_LINUX) | 212 #elif defined(OS_LINUX) || defined(OS_OPENBSD) |
213 parts_list->push_back(new ChromeBrowserMainPartsLinux(parameters)); | 213 parts_list->push_back(new ChromeBrowserMainPartsLinux(parameters)); |
214 #elif defined(OS_POSIX) | 214 #elif defined(OS_POSIX) |
215 parts_list->push_back(new ChromeBrowserMainPartsPosix(parameters)); | 215 parts_list->push_back(new ChromeBrowserMainPartsPosix(parameters)); |
216 #else | 216 #else |
217 NOTREACHED(); | 217 NOTREACHED(); |
218 parts_list->push_back(new ChromeBrowserMainParts(parameters)); | 218 parts_list->push_back(new ChromeBrowserMainParts(parameters)); |
219 #endif | 219 #endif |
220 | 220 |
221 // Construct additional browser parts. | 221 // Construct additional browser parts. |
222 #if defined(USE_AURA) | 222 #if defined(USE_AURA) |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 } | 944 } |
945 | 945 |
946 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { | 946 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { |
947 return download_util::GetDefaultDownloadDirectory(); | 947 return download_util::GetDefaultDownloadDirectory(); |
948 } | 948 } |
949 | 949 |
950 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { | 950 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { |
951 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); | 951 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); |
952 } | 952 } |
953 | 953 |
954 #if defined(OS_LINUX) | 954 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
955 int ChromeContentBrowserClient::GetCrashSignalFD( | 955 int ChromeContentBrowserClient::GetCrashSignalFD( |
956 const CommandLine& command_line) { | 956 const CommandLine& command_line) { |
957 if (command_line.HasSwitch(switches::kExtensionProcess)) { | 957 if (command_line.HasSwitch(switches::kExtensionProcess)) { |
958 ExtensionCrashHandlerHostLinux* crash_handler = | 958 ExtensionCrashHandlerHostLinux* crash_handler = |
959 ExtensionCrashHandlerHostLinux::GetInstance(); | 959 ExtensionCrashHandlerHostLinux::GetInstance(); |
960 return crash_handler->GetDeathSignalSocket(); | 960 return crash_handler->GetDeathSignalSocket(); |
961 } | 961 } |
962 | 962 |
963 std::string process_type = | 963 std::string process_type = |
964 command_line.GetSwitchValueASCII(switches::kProcessType); | 964 command_line.GetSwitchValueASCII(switches::kProcessType); |
965 | 965 |
966 if (process_type == switches::kRendererProcess) | 966 if (process_type == switches::kRendererProcess) |
967 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 967 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
968 | 968 |
969 if (process_type == switches::kPluginProcess) | 969 if (process_type == switches::kPluginProcess) |
970 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 970 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
971 | 971 |
972 if (process_type == switches::kPpapiPluginProcess) | 972 if (process_type == switches::kPpapiPluginProcess) |
973 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 973 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
974 | 974 |
975 if (process_type == switches::kGpuProcess) | 975 if (process_type == switches::kGpuProcess) |
976 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); | 976 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); |
977 | 977 |
978 return -1; | 978 return -1; |
979 } | 979 } |
980 #endif // defined(OS_LINUX) | 980 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) |
981 | 981 |
982 #if defined(OS_WIN) | 982 #if defined(OS_WIN) |
983 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { | 983 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { |
984 return chrome::kBrowserResourcesDll; | 984 return chrome::kBrowserResourcesDll; |
985 } | 985 } |
986 #endif | 986 #endif |
987 | 987 |
988 #if defined(USE_NSS) | 988 #if defined(USE_NSS) |
989 crypto::CryptoModuleBlockingPasswordDelegate* | 989 crypto::CryptoModuleBlockingPasswordDelegate* |
990 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 990 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
991 const GURL& url) { | 991 const GURL& url) { |
992 return browser::NewCryptoModuleBlockingDialogDelegate( | 992 return browser::NewCryptoModuleBlockingDialogDelegate( |
993 browser::kCryptoModulePasswordKeygen, url.host()); | 993 browser::kCryptoModulePasswordKeygen, url.host()); |
994 } | 994 } |
995 #endif | 995 #endif |
996 | 996 |
997 } // namespace chrome | 997 } // namespace chrome |
OLD | NEW |