| 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_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 <signal.h> | 9 #include <signal.h> |
| 10 #include <sys/resource.h> | 10 #include <sys/resource.h> |
| 11 #include <unistd.h> | 11 #include <unistd.h> |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/eintr_wrapper.h" | 16 #include "base/eintr_wrapper.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
| 19 #include "chrome/browser/ui/browser_list.h" | 19 #include "chrome/browser/ui/browser_list.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "content/browser/browser_thread.h" | 21 #include "content/browser/browser_thread.h" |
| 22 | 22 |
| 23 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) | 23 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 24 #include "chrome/browser/printing/print_dialog_gtk.h" | 24 #include "chrome/browser/printing/print_dialog_gtk.h" |
| 25 #endif | 25 #endif |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // See comment in |PreEarlyInitialization()|, where sigaction is called. | 29 // See comment in |PreEarlyInitialization()|, where sigaction is called. |
| 30 void SIGCHLDHandler(int signal) { | 30 void SIGCHLDHandler(int signal) { |
| 31 } | 31 } |
| 32 | 32 |
| 33 int g_shutdown_pipe_write_fd = -1; | 33 int g_shutdown_pipe_write_fd = -1; |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 CHECK(sigaction(SIGTERM, &action, NULL) == 0); | 248 CHECK(sigaction(SIGTERM, &action, NULL) == 0); |
| 249 // Also handle SIGINT - when the user terminates the browser via Ctrl+C. If | 249 // Also handle SIGINT - when the user terminates the browser via Ctrl+C. If |
| 250 // the browser process is being debugged, GDB will catch the SIGINT first. | 250 // the browser process is being debugged, GDB will catch the SIGINT first. |
| 251 action.sa_handler = SIGINTHandler; | 251 action.sa_handler = SIGINTHandler; |
| 252 CHECK(sigaction(SIGINT, &action, NULL) == 0); | 252 CHECK(sigaction(SIGINT, &action, NULL) == 0); |
| 253 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux | 253 // And SIGHUP, for when the terminal disappears. On shutdown, many Linux |
| 254 // distros send SIGHUP, SIGTERM, and then SIGKILL. | 254 // distros send SIGHUP, SIGTERM, and then SIGKILL. |
| 255 action.sa_handler = SIGHUPHandler; | 255 action.sa_handler = SIGHUPHandler; |
| 256 CHECK(sigaction(SIGHUP, &action, NULL) == 0); | 256 CHECK(sigaction(SIGHUP, &action, NULL) == 0); |
| 257 | 257 |
| 258 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) | 258 #if defined(TOOLKIT_USES_GTK) && !defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 259 printing::PrintingContextCairo::SetCreatePrintDialogFunction( | 259 printing::PrintingContextCairo::SetCreatePrintDialogFunction( |
| 260 &PrintDialogGtk::CreatePrintDialog); | 260 &PrintDialogGtk::CreatePrintDialog); |
| 261 #endif | 261 #endif |
| 262 } | 262 } |
| OLD | NEW |