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_browser_main_posix.h" | 5 #include "chrome/browser/chrome_browser_main_posix.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
8 #include <limits.h> | 8 #include <limits.h> |
9 #include <pthread.h> | 9 #include <pthread.h> |
10 #include <signal.h> | 10 #include <signal.h> |
11 #include <sys/resource.h> | 11 #include <sys/resource.h> |
12 #include <unistd.h> | 12 #include <unistd.h> |
13 | 13 |
14 #include <string> | 14 #include <string> |
15 | 15 |
16 #include "base/bind.h" | 16 #include "base/bind.h" |
17 #include "base/command_line.h" | 17 #include "base/command_line.h" |
18 #include "base/eintr_wrapper.h" | 18 #include "base/eintr_wrapper.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/string_number_conversions.h" | 20 #include "base/string_number_conversions.h" |
21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
22 #include "chrome/common/chrome_switches.h" | 22 #include "chrome/common/chrome_switches.h" |
23 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
24 | 24 |
25 #if defined(OS_ANDROID) | 25 #if defined(OS_ANDROID) |
26 #include <asm/page.h> // for PAGE_SIZE needed by PTHREAD_STACK_MIN | 26 #include <asm/page.h> // for PAGE_SIZE needed by PTHREAD_STACK_MIN |
27 #endif | 27 #endif |
28 | 28 |
29 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) | 29 #if defined(TOOLKIT_USES_GTK) |
Lei Zhang
2012/03/22 23:02:20
These are mutually exclusive.
| |
30 #include "chrome/browser/chrome_browser_main_extra_parts_gtk.h" | |
30 #include "chrome/browser/printing/print_dialog_gtk.h" | 31 #include "chrome/browser/printing/print_dialog_gtk.h" |
31 #endif | 32 #endif |
32 | 33 |
33 using content::BrowserThread; | 34 using content::BrowserThread; |
34 | 35 |
35 namespace { | 36 namespace { |
36 | 37 |
37 // See comment in |PreEarlyInitialization()|, where sigaction is called. | 38 // See comment in |PreEarlyInitialization()|, where sigaction is called. |
38 void SIGCHLDHandler(int signal) { | 39 void SIGCHLDHandler(int signal) { |
39 } | 40 } |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
260 CHECK(sigaction(SIGTERM, &action, NULL) == 0); | 261 CHECK(sigaction(SIGTERM, &action, NULL) == 0); |
261 // Also handle SIGINT - when the user terminates the browser via Ctrl+C. If | 262 // Also handle SIGINT - when the user terminates the browser via Ctrl+C. If |
262 // the browser process is being debugged, GDB will catch the SIGINT first. | 263 // the browser process is being debugged, GDB will catch the SIGINT first. |
263 action.sa_handler = SIGINTHandler; | 264 action.sa_handler = SIGINTHandler; |
264 CHECK(sigaction(SIGINT, &action, NULL) == 0); | 265 CHECK(sigaction(SIGINT, &action, NULL) == 0); |
265 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux | 266 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux |
266 // distros send SIGHUP, SIGTERM, and then SIGKILL. | 267 // distros send SIGHUP, SIGTERM, and then SIGKILL. |
267 action.sa_handler = SIGHUPHandler; | 268 action.sa_handler = SIGHUPHandler; |
268 CHECK(sigaction(SIGHUP, &action, NULL) == 0); | 269 CHECK(sigaction(SIGHUP, &action, NULL) == 0); |
269 | 270 |
270 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) | 271 #if defined(TOOLKIT_USES_GTK) |
271 printing::PrintingContextGtk::SetCreatePrintDialogFunction( | 272 printing::PrintingContextGtk::SetCreatePrintDialogFunction( |
272 &PrintDialogGtk::CreatePrintDialog); | 273 &PrintDialogGtk::CreatePrintDialog); |
273 #endif | 274 #endif |
274 } | 275 } |
276 | |
277 void ChromeBrowserMainPartsPosix::ShowMissingLocaleMessageBox() { | |
278 #if defined(OS_CHROMEOS) | |
279 NOTREACHED(); // Should not ever happen on ChromeOS. | |
Lei Zhang
2012/03/22 23:02:20
stevenjb: in r109069, you put USE_AURA here, but I
stevenjb
2012/03/22 23:31:07
Aura should never call ShowMissingLocaleMessageBox
Lei Zhang
2012/03/22 23:37:10
Yes, this would be #error on Linux + Aura, which d
| |
280 #elif defined(OS_ANDROID) | |
281 // TODO(port) Update this as needed. | |
282 // Probably should not ever happen on Android, but at the time of this | |
283 // writing, Android isn't even using ChromeBrowserMainPartsPosix yet. | |
284 NOTREACHED(); | |
285 #elif defined(OS_MACOSX) | |
286 // Not called on Mac because we load the locale files differently. | |
287 NOTREACHED(); | |
288 #elif defined(TOOLKIT_USES_GTK) | |
289 ChromeBrowserMainExtraPartsGtk::ShowMessageBox( | |
290 chrome_browser::kMissingLocaleDataMessage); | |
291 #else | |
292 #error "Need MessageBox implementation." | |
293 #endif | |
294 } | |
OLD | NEW |