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

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

Issue 7779040: Start moving code from BrowserMain to content, so that it can be reused by all embedders of conte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix windows unittest Created 9 years, 3 months 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 | Annotate | Revision Log
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/browser_main_gtk.h" 5 #include "chrome/browser/browser_main_gtk.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <sys/stat.h> 8 #include <sys/stat.h>
9 #include <sys/types.h> 9 #include <sys/types.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 g_in_x11_io_error_handler = true; 74 g_in_x11_io_error_handler = true;
75 LOG(ERROR) << "X IO Error detected"; 75 LOG(ERROR) << "X IO Error detected";
76 BrowserList::SessionEnding(); 76 BrowserList::SessionEnding();
77 } 77 }
78 78
79 return 0; 79 return 0;
80 } 80 }
81 81
82 } // namespace 82 } // namespace
83 83
84 BrowserMainPartsGtk::BrowserMainPartsGtk(const MainFunctionParams& parameters)
85 : BrowserMainPartsPosix(parameters) {
86 }
87
84 void BrowserMainPartsGtk::PreEarlyInitialization() { 88 void BrowserMainPartsGtk::PreEarlyInitialization() {
85 DetectRunningAsRoot(); 89 DetectRunningAsRoot();
86 90
87 BrowserMainPartsPosix::PreEarlyInitialization(); 91 BrowserMainPartsPosix::PreEarlyInitialization();
88 92
89 SetupSandbox(); 93 SetupSandbox();
90 94
91 #if defined(USE_NSS) 95 #if defined(USE_NSS)
92 // We want to be sure to init NSPR on the main thread. 96 // We want to be sure to init NSPR on the main thread.
93 crypto::EnsureNSPRInit(); 97 crypto::EnsureNSPRInit();
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (sandbox_binary && !parsed_command_line().HasSwitch(switches::kNoSandbox)) 160 if (sandbox_binary && !parsed_command_line().HasSwitch(switches::kNoSandbox))
157 sandbox_cmd = sandbox_binary; 161 sandbox_cmd = sandbox_binary;
158 162
159 // Tickle the sandbox host and zygote host so they fork now. 163 // Tickle the sandbox host and zygote host so they fork now.
160 RenderSandboxHostLinux* shost = RenderSandboxHostLinux::GetInstance(); 164 RenderSandboxHostLinux* shost = RenderSandboxHostLinux::GetInstance();
161 shost->Init(sandbox_cmd); 165 shost->Init(sandbox_cmd);
162 ZygoteHost* zhost = ZygoteHost::GetInstance(); 166 ZygoteHost* zhost = ZygoteHost::GetInstance();
163 zhost->Init(sandbox_cmd); 167 zhost->Init(sandbox_cmd);
164 } 168 }
165 169
170 namespace content {
171
166 void DidEndMainMessageLoop() { 172 void DidEndMainMessageLoop() {
167 } 173 }
168 174
175 }
176
169 void RecordBreakpadStatusUMA(MetricsService* metrics) { 177 void RecordBreakpadStatusUMA(MetricsService* metrics) {
170 #if defined(USE_LINUX_BREAKPAD) 178 #if defined(USE_LINUX_BREAKPAD)
171 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled()); 179 metrics->RecordBreakpadRegistration(IsCrashReporterEnabled());
172 #else 180 #else
173 metrics->RecordBreakpadRegistration(false); 181 metrics->RecordBreakpadRegistration(false);
174 #endif 182 #endif
175 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged()); 183 metrics->RecordBreakpadHasDebugger(base::debug::BeingDebugged());
176 } 184 }
177 185
178 void WarnAboutMinimumSystemRequirements() { 186 void WarnAboutMinimumSystemRequirements() {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 222 }
215 223
216 void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) { 224 void PrepareRestartOnCrashEnviroment(const CommandLine &parsed_command_line) {
217 } 225 }
218 226
219 void SetBrowserX11ErrorHandlers() { 227 void SetBrowserX11ErrorHandlers() {
220 // Set up error handlers to make sure profile gets written if X server 228 // Set up error handlers to make sure profile gets written if X server
221 // goes away. 229 // goes away.
222 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler); 230 ui::SetX11ErrorHandlers(BrowserX11ErrorHandler, BrowserX11IOErrorHandler);
223 } 231 }
224
225 #if !defined(OS_CHROMEOS)
226 // static
227 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts(
228 const MainFunctionParams& parameters) {
229 return new BrowserMainPartsGtk(parameters);
230 }
231 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698