Chromium Code Reviews| 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 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, | 205 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, |
| 206 base::Bind(&ExitCleanly)); | 206 base::Bind(&ExitCleanly)); |
| 207 #else | 207 #else |
| 208 // Set the flag to restore state after the restart. | 208 // Set the flag to restore state after the restart. |
| 209 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true); | 209 pref_service->SetBoolean(prefs::kRestartLastSessionOnShutdown, true); |
| 210 AttemptExit(); | 210 AttemptExit(); |
| 211 #endif | 211 #endif |
| 212 } | 212 } |
| 213 #endif | 213 #endif |
| 214 | 214 |
| 215 void AttemptRelaunch() { | |
| 216 #if defined(OS_CHROMEOS) | |
|
Lei Zhang
2016/06/09 00:50:40
UpdateRecommendedMessageBox::Accept() is another p
dpapad
2016/06/09 01:14:27
Done, changed this to use UpdateRecommendedMessage
| |
| 217 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestRestart(); | |
| 218 #else | |
| 219 chrome::AttemptRestart(); | |
| 220 #endif | |
| 221 } | |
| 222 | |
| 215 void AttemptExit() { | 223 void AttemptExit() { |
| 216 #if defined(OS_CHROMEOS) | 224 #if defined(OS_CHROMEOS) |
| 217 // On ChromeOS, user exit and system exits are the same. | 225 // On ChromeOS, user exit and system exits are the same. |
| 218 AttemptUserExit(); | 226 AttemptUserExit(); |
| 219 #else | 227 #else |
| 220 // If we know that all browsers can be closed without blocking, | 228 // If we know that all browsers can be closed without blocking, |
| 221 // don't notify users of crashes beyond this point. | 229 // don't notify users of crashes beyond this point. |
| 222 // Note that MarkAsCleanShutdown() does not set UMA's exit cleanly bit | 230 // Note that MarkAsCleanShutdown() does not set UMA's exit cleanly bit |
| 223 // so crashes during shutdown are still reported in UMA. | 231 // so crashes during shutdown are still reported in UMA. |
| 224 #if !defined(OS_ANDROID) | 232 #if !defined(OS_ANDROID) |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 357 void OnAppExiting() { | 365 void OnAppExiting() { |
| 358 static bool notified = false; | 366 static bool notified = false; |
| 359 if (notified) | 367 if (notified) |
| 360 return; | 368 return; |
| 361 notified = true; | 369 notified = true; |
| 362 HandleAppExitingForPlatform(); | 370 HandleAppExitingForPlatform(); |
| 363 } | 371 } |
| 364 #endif // !defined(OS_ANDROID) | 372 #endif // !defined(OS_ANDROID) |
| 365 | 373 |
| 366 } // namespace chrome | 374 } // namespace chrome |
| OLD | NEW |