| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 228 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 229 base::Bind(&ExitCleanly)); | 229 base::Bind(&ExitCleanly)); |
| 230 #else | 230 #else |
| 231 // Set the flag to restore state after the restart. | 231 // Set the flag to restore state after the restart. |
| 232 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true); | 232 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true); |
| 233 AttemptExit(); | 233 AttemptExit(); |
| 234 #endif | 234 #endif |
| 235 } | 235 } |
| 236 #endif // !defined(OS_ANDROID) | 236 #endif // !defined(OS_ANDROID) |
| 237 | 237 |
| 238 void AttemptRelaunch() { |
| 239 #if defined(OS_CHROMEOS) |
| 240 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); |
| 241 // If running the Chrome OS build, but we're not on the device, fall through. |
| 242 #endif |
| 243 chrome::AttemptRestart(); |
| 244 } |
| 245 |
| 238 void AttemptExit() { | 246 void AttemptExit() { |
| 239 #if defined(OS_CHROMEOS) | 247 #if defined(OS_CHROMEOS) |
| 240 // On ChromeOS, user exit and system exits are the same. | 248 // On ChromeOS, user exit and system exits are the same. |
| 241 AttemptUserExit(); | 249 AttemptUserExit(); |
| 242 #else | 250 #else |
| 243 // If we know that all browsers can be closed without blocking, | 251 // If we know that all browsers can be closed without blocking, |
| 244 // don't notify users of crashes beyond this point. | 252 // don't notify users of crashes beyond this point. |
| 245 // Note that MarkAsCleanShutdown() does not set UMA's exit cleanly bit | 253 // Note that MarkAsCleanShutdown() does not set UMA's exit cleanly bit |
| 246 // so crashes during shutdown are still reported in UMA. | 254 // so crashes during shutdown are still reported in UMA. |
| 247 #if !defined(OS_ANDROID) | 255 #if !defined(OS_ANDROID) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 void OnAppExiting() { | 388 void OnAppExiting() { |
| 381 static bool notified = false; | 389 static bool notified = false; |
| 382 if (notified) | 390 if (notified) |
| 383 return; | 391 return; |
| 384 notified = true; | 392 notified = true; |
| 385 HandleAppExitingForPlatform(); | 393 HandleAppExitingForPlatform(); |
| 386 } | 394 } |
| 387 #endif // !defined(OS_ANDROID) | 395 #endif // !defined(OS_ANDROID) |
| 388 | 396 |
| 389 } // namespace chrome | 397 } // namespace chrome |
| OLD | NEW |