| 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/lifetime/application_lifetime.h" | 5 #include "chrome/browser/lifetime/application_lifetime.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 if (AreAllBrowsersCloseable()) | 232 if (AreAllBrowsersCloseable()) |
| 233 MarkAsCleanShutdown(); | 233 MarkAsCleanShutdown(); |
| 234 #endif | 234 #endif |
| 235 AttemptExitInternal(true); | 235 AttemptExitInternal(true); |
| 236 #endif | 236 #endif |
| 237 } | 237 } |
| 238 | 238 |
| 239 #if defined(OS_CHROMEOS) | 239 #if defined(OS_CHROMEOS) |
| 240 // A function called when SIGTERM is received. | 240 // A function called when SIGTERM is received. |
| 241 void ExitCleanly() { | 241 void ExitCleanly() { |
| 242 // We always mark exit cleanly because SessionManager may kill | 242 // We always mark exit cleanly. |
| 243 // chrome in 3 seconds after SIGTERM. | 243 MarkAsCleanShutdown(); |
| 244 g_browser_process->EndSession(); | |
| 245 | 244 |
| 246 // Don't block when SIGTERM is received. AreaAllBrowsersCloseable() | 245 // Don't block when SIGTERM is received. AreaAllBrowsersCloseable() |
| 247 // can be false in following cases. a) power-off b) signout from | 246 // can be false in following cases. a) power-off b) signout from |
| 248 // screen locker. | 247 // screen locker. |
| 249 if (!AreAllBrowsersCloseable()) | 248 if (!AreAllBrowsersCloseable()) |
| 250 browser_shutdown::OnShutdownStarting(browser_shutdown::END_SESSION); | 249 browser_shutdown::OnShutdownStarting(browser_shutdown::END_SESSION); |
| 251 else | 250 else |
| 252 browser_shutdown::OnShutdownStarting(browser_shutdown::BROWSER_EXIT); | 251 browser_shutdown::OnShutdownStarting(browser_shutdown::BROWSER_EXIT); |
| 253 AttemptExitInternal(true); | 252 AttemptExitInternal(true); |
| 254 } | 253 } |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 // environment is still active. | 413 // environment is still active. |
| 415 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | 414 if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) |
| 416 return !ash::Shell::HasInstance(); | 415 return !ash::Shell::HasInstance(); |
| 417 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) | 416 else if (browser->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) |
| 418 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); | 417 return BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_NATIVE)->empty(); |
| 419 #endif | 418 #endif |
| 420 return true; | 419 return true; |
| 421 } | 420 } |
| 422 | 421 |
| 423 } // namespace chrome | 422 } // namespace chrome |
| OLD | NEW |