summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 21:23:35 +0000
committercmasone@google.com <cmasone@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-07 21:23:35 +0000
commit965e4c45ae4111d7a36a3606bb984db2fc5ff39e (patch)
treeb2894b85a2d43e30d3ba8122d410766aafeff87d
parent4bce24e4288130d9436863d1db3ee0295ed93277 (diff)
downloadchromium_src-965e4c45ae4111d7a36a3606bb984db2fc5ff39e.zip
chromium_src-965e4c45ae4111d7a36a3606bb984db2fc5ff39e.tar.gz
chromium_src-965e4c45ae4111d7a36a3606bb984db2fc5ff39e.tar.bz2
[Chrome OS] Make Chrome call session_manager to trigger exit
On Chromium OS, instead of letting the browser exit directly, we want to allow another process to trigger and watch shutdown, because otherwise we have no way of dealing with chrome hanging on exit. BUG=chromium-os:5395 TEST=Install chrome on a device, log in and log out. Look at /var/log/session_manager to determine that it triggered the browser exit. Review URL: http://codereview.chromium.org/3112012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58757 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/browser.cc9
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc5
2 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index a5242c4..9440599 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -120,6 +120,8 @@
#endif
#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/cros/login_library.h"
#include "chrome/browser/chromeos/options/language_config_view.h"
#include "chrome/browser/views/app_launcher.h"
#endif
@@ -1444,6 +1446,13 @@ void Browser::Search() {
void Browser::Exit() {
UserMetrics::RecordAction(UserMetricsAction("Exit"), profile_);
+#if defined(OS_CHROMEOS)
+ if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
+ chromeos::CrosLibrary::Get()->GetLoginLibrary()->StopSession("");
+ return;
+ }
+ // If running the Chrome OS build, but we're not on the device, fall through
+#endif
BrowserList::CloseAllBrowsersAndExit();
}
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index 85cc6bd..67bc363 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/chromeos/cros/input_method_library.h"
+#include "chrome/browser/chromeos/cros/login_library.h"
#include "chrome/browser/chromeos/cros/screen_lock_library.h"
#include "chrome/browser/chromeos/language_preferences.h"
#include "chrome/browser/chromeos/login/authenticator.h"
@@ -636,7 +637,9 @@ void ScreenLocker::EnableInput() {
void ScreenLocker::Signout() {
if (!error_info_) {
// TODO(oshima): record this action in user metrics.
- BrowserList::CloseAllBrowsersAndExit();
+ if (CrosLibrary::Get()->EnsureLoaded()) {
+ CrosLibrary::Get()->GetLoginLibrary()->StopSession("");
+ }
// Don't hide yet the locker because the chrome screen may become visible
// briefly.