Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 8341052: share all the needed linux code with OpenBSD in chrome and content (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebased due to LOG macro changes Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "chrome/app/breakpad_mac.h" 9 #include "chrome/app/breakpad_mac.h"
10 #include "chrome/browser/browser_about_handler.h" 10 #include "chrome/browser/browser_about_handler.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 #include "net/base/cookie_options.h" 78 #include "net/base/cookie_options.h"
79 #include "ui/base/l10n/l10n_util.h" 79 #include "ui/base/l10n/l10n_util.h"
80 #include "ui/base/resource/resource_bundle.h" 80 #include "ui/base/resource/resource_bundle.h"
81 81
82 #if defined(OS_WIN) 82 #if defined(OS_WIN)
83 #include "chrome/browser/chrome_browser_main_win.h" 83 #include "chrome/browser/chrome_browser_main_win.h"
84 #elif defined(OS_MACOSX) 84 #elif defined(OS_MACOSX)
85 #include "chrome/browser/chrome_browser_main_mac.h" 85 #include "chrome/browser/chrome_browser_main_mac.h"
86 #elif defined(OS_CHROMEOS) 86 #elif defined(OS_CHROMEOS)
87 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h" 87 #include "chrome/browser/chromeos/chrome_browser_main_chromeos.h"
88 #elif defined(OS_LINUX) 88 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
89 #include "chrome/browser/chrome_browser_main_linux.h" 89 #include "chrome/browser/chrome_browser_main_linux.h"
90 #elif defined(OS_POSIX) 90 #elif defined(OS_POSIX)
91 #include "chrome/browser/chrome_browser_main_posix.h" 91 #include "chrome/browser/chrome_browser_main_posix.h"
92 #endif 92 #endif
93 93
94 #if defined(TOOLKIT_USES_GTK) 94 #if defined(TOOLKIT_USES_GTK)
95 #include "chrome/browser/chrome_browser_parts_gtk.h" 95 #include "chrome/browser/chrome_browser_parts_gtk.h"
96 #endif 96 #endif
97 97
98 #if defined(TOOLKIT_VIEWS) 98 #if defined(TOOLKIT_VIEWS)
99 #include "chrome/browser/chrome_browser_parts_views.h" 99 #include "chrome/browser/chrome_browser_parts_views.h"
100 #endif 100 #endif
101 101
102 #if defined(USE_AURA) 102 #if defined(USE_AURA)
103 #include "chrome/browser/chrome_browser_parts_aura.h" 103 #include "chrome/browser/chrome_browser_parts_aura.h"
104 #endif 104 #endif
105 105
106 #if defined(OS_LINUX) 106 #if defined(OS_LINUX) || defined(OS_OPENBSD)
107 #include "base/linux_util.h" 107 #include "base/linux_util.h"
108 #include "chrome/browser/crash_handler_host_linux.h" 108 #include "chrome/browser/crash_handler_host_linux.h"
109 #endif 109 #endif
110 110
111 #if defined(TOUCH_UI) 111 #if defined(TOUCH_UI)
112 #include "chrome/browser/chrome_browser_parts_touch.h" 112 #include "chrome/browser/chrome_browser_parts_touch.h"
113 #endif 113 #endif
114 114
115 #if defined(TOOLKIT_VIEWS) 115 #if defined(TOOLKIT_VIEWS)
116 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" 116 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void ChromeContentBrowserClient::CreateBrowserMainParts( 220 void ChromeContentBrowserClient::CreateBrowserMainParts(
221 const content::MainFunctionParams& parameters, 221 const content::MainFunctionParams& parameters,
222 std::vector<content::BrowserMainParts*>* parts_list) { 222 std::vector<content::BrowserMainParts*>* parts_list) {
223 // Construct the Main browser parts based on the OS type. 223 // Construct the Main browser parts based on the OS type.
224 #if defined(OS_WIN) 224 #if defined(OS_WIN)
225 parts_list->push_back(new ChromeBrowserMainPartsWin(parameters)); 225 parts_list->push_back(new ChromeBrowserMainPartsWin(parameters));
226 #elif defined(OS_MACOSX) 226 #elif defined(OS_MACOSX)
227 parts_list->push_back(new ChromeBrowserMainPartsMac(parameters)); 227 parts_list->push_back(new ChromeBrowserMainPartsMac(parameters));
228 #elif defined(OS_CHROMEOS) 228 #elif defined(OS_CHROMEOS)
229 parts_list->push_back(new ChromeBrowserMainPartsChromeos(parameters)); 229 parts_list->push_back(new ChromeBrowserMainPartsChromeos(parameters));
230 #elif defined(OS_LINUX) 230 #elif defined(OS_LINUX) || defined(OS_OPENBSD)
231 parts_list->push_back(new ChromeBrowserMainPartsLinux(parameters)); 231 parts_list->push_back(new ChromeBrowserMainPartsLinux(parameters));
232 #elif defined(OS_POSIX) 232 #elif defined(OS_POSIX)
233 parts_list->push_back(new ChromeBrowserMainPartsPosix(parameters)); 233 parts_list->push_back(new ChromeBrowserMainPartsPosix(parameters));
234 #else 234 #else
235 NOTREACHED(); 235 NOTREACHED();
236 parts_list->push_back(new ChromeBrowserMainParts(parameters)); 236 parts_list->push_back(new ChromeBrowserMainParts(parameters));
237 #endif 237 #endif
238 238
239 // Construct additional browser parts. Stages are called in the order in 239 // Construct additional browser parts. Stages are called in the order in
240 // which they are added. 240 // which they are added.
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
1018 } 1018 }
1019 1019
1020 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() { 1020 FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
1021 return download_util::GetDefaultDownloadDirectory(); 1021 return download_util::GetDefaultDownloadDirectory();
1022 } 1022 }
1023 1023
1024 std::string ChromeContentBrowserClient::GetDefaultDownloadName() { 1024 std::string ChromeContentBrowserClient::GetDefaultDownloadName() {
1025 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME); 1025 return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME);
1026 } 1026 }
1027 1027
1028 #if defined(OS_LINUX) 1028 #if defined(OS_POSIX) && !defined(OS_MACOSX)
1029 int ChromeContentBrowserClient::GetCrashSignalFD( 1029 int ChromeContentBrowserClient::GetCrashSignalFD(
1030 const CommandLine& command_line) { 1030 const CommandLine& command_line) {
1031 if (command_line.HasSwitch(switches::kExtensionProcess)) { 1031 if (command_line.HasSwitch(switches::kExtensionProcess)) {
1032 ExtensionCrashHandlerHostLinux* crash_handler = 1032 ExtensionCrashHandlerHostLinux* crash_handler =
1033 ExtensionCrashHandlerHostLinux::GetInstance(); 1033 ExtensionCrashHandlerHostLinux::GetInstance();
1034 return crash_handler->GetDeathSignalSocket(); 1034 return crash_handler->GetDeathSignalSocket();
1035 } 1035 }
1036 1036
1037 std::string process_type = 1037 std::string process_type =
1038 command_line.GetSwitchValueASCII(switches::kProcessType); 1038 command_line.GetSwitchValueASCII(switches::kProcessType);
1039 1039
1040 if (process_type == switches::kRendererProcess) 1040 if (process_type == switches::kRendererProcess)
1041 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 1041 return RendererCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
1042 1042
1043 if (process_type == switches::kPluginProcess) 1043 if (process_type == switches::kPluginProcess)
1044 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 1044 return PluginCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
1045 1045
1046 if (process_type == switches::kPpapiPluginProcess) 1046 if (process_type == switches::kPpapiPluginProcess)
1047 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 1047 return PpapiCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
1048 1048
1049 if (process_type == switches::kGpuProcess) 1049 if (process_type == switches::kGpuProcess)
1050 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket(); 1050 return GpuCrashHandlerHostLinux::GetInstance()->GetDeathSignalSocket();
1051 1051
1052 return -1; 1052 return -1;
1053 } 1053 }
1054 #endif // defined(OS_LINUX) 1054 #endif // defined(OS_POSIX) && !defined(OS_MACOSX)
1055 1055
1056 #if defined(OS_WIN) 1056 #if defined(OS_WIN)
1057 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() { 1057 const wchar_t* ChromeContentBrowserClient::GetResourceDllName() {
1058 return chrome::kBrowserResourcesDll; 1058 return chrome::kBrowserResourcesDll;
1059 } 1059 }
1060 #endif 1060 #endif
1061 1061
1062 #if defined(USE_NSS) 1062 #if defined(USE_NSS)
1063 crypto::CryptoModuleBlockingPasswordDelegate* 1063 crypto::CryptoModuleBlockingPasswordDelegate*
1064 ChromeContentBrowserClient::GetCryptoPasswordDelegate( 1064 ChromeContentBrowserClient::GetCryptoPasswordDelegate(
1065 const GURL& url) { 1065 const GURL& url) {
1066 return browser::NewCryptoModuleBlockingDialogDelegate( 1066 return browser::NewCryptoModuleBlockingDialogDelegate(
1067 browser::kCryptoModulePasswordKeygen, url.host()); 1067 browser::kCryptoModulePasswordKeygen, url.host());
1068 } 1068 }
1069 #endif 1069 #endif
1070 1070
1071 } // namespace chrome 1071 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698