summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-29 20:03:05 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-29 20:03:05 +0000
commit8d4db9d979a78a413fb28e02ae286643c86972ee (patch)
treecceb23eecfc09c149df74aefe81c5d8d1ba29a4b /chrome/browser
parentc342ddf08e07a96ac3c17fc73cdd8d87b9628b28 (diff)
downloadchromium_src-8d4db9d979a78a413fb28e02ae286643c86972ee.zip
chromium_src-8d4db9d979a78a413fb28e02ae286643c86972ee.tar.gz
chromium_src-8d4db9d979a78a413fb28e02ae286643c86972ee.tar.bz2
chromeos: Notify window manager about signout.
This makes us send a message to the window manager when the user is logging out so the window manager can display a more graceful transition (currently, you can sometimes see the browser windows getting closed one by one). The power manager already sends a similar message to the window manager when we're shutting down. BUG=chromium-os:9915 TEST=built and tried it with an updated window manager. try bots pass too Review URL: http://codereview.chromium.org/6047005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70270 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser_shutdown.cc2
-rw-r--r--chrome/browser/chromeos/login/screen_locker.cc1
-rw-r--r--chrome/browser/chromeos/wm_ipc.cc5
-rw-r--r--chrome/browser/chromeos/wm_ipc.h3
-rw-r--r--chrome/browser/ui/browser_list.cc2
5 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/browser_shutdown.cc b/chrome/browser/browser_shutdown.cc
index a312523..67f5b9d 100644
--- a/chrome/browser/browser_shutdown.cc
+++ b/chrome/browser/browser_shutdown.cc
@@ -48,6 +48,7 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/login_library.h"
+#include "chrome/browser/chromeos/wm_ipc.h"
#endif
using base::Time;
@@ -251,6 +252,7 @@ void Shutdown() {
UnregisterURLRequestChromeJob();
#if defined(OS_CHROMEOS)
+ chromeos::WmIpc::instance()->NotifyAboutSignout();
if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
chromeos::CrosLibrary::Get()->GetLoginLibrary()->StopSession("");
}
diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc
index 0a3ef83..d927935 100644
--- a/chrome/browser/chromeos/login/screen_locker.cc
+++ b/chrome/browser/chromeos/login/screen_locker.cc
@@ -872,6 +872,7 @@ void ScreenLocker::EnableInput() {
void ScreenLocker::Signout() {
if (!error_info_) {
UserMetrics::RecordAction(UserMetricsAction("ScreenLocker_Signout"));
+ WmIpc::instance()->NotifyAboutSignout();
if (CrosLibrary::Get()->EnsureLoaded()) {
CrosLibrary::Get()->GetLoginLibrary()->StopSession("");
}
diff --git a/chrome/browser/chromeos/wm_ipc.cc b/chrome/browser/chromeos/wm_ipc.cc
index aa09dd7..3e856f3 100644
--- a/chrome/browser/chromeos/wm_ipc.cc
+++ b/chrome/browser/chromeos/wm_ipc.cc
@@ -163,6 +163,11 @@ void WmIpc::SetLoggedInProperty(bool logged_in) {
values);
}
+void WmIpc::NotifyAboutSignout() {
+ Message msg(chromeos::WM_IPC_MESSAGE_WM_NOTIFY_SIGNING_OUT);
+ SendMessage(msg);
+}
+
WmIpc::WmIpc() {
scoped_array<char*> names(new char*[kNumAtoms]);
scoped_array<Atom> atoms(new Atom[kNumAtoms]);
diff --git a/chrome/browser/chromeos/wm_ipc.h b/chrome/browser/chromeos/wm_ipc.h
index a0c8abd..a8bfeb5 100644
--- a/chrome/browser/chromeos/wm_ipc.h
+++ b/chrome/browser/chromeos/wm_ipc.h
@@ -115,6 +115,9 @@ class WmIpc {
// the user is currently logged in or not.
void SetLoggedInProperty(bool logged_in);
+ // Sends a message to the window manager notifying it that we're signing out.
+ void NotifyAboutSignout();
+
private:
friend struct base::DefaultLazyInstanceTraits<WmIpc>;
diff --git a/chrome/browser/ui/browser_list.cc b/chrome/browser/ui/browser_list.cc
index dfdd576..ec5fef1 100644
--- a/chrome/browser/ui/browser_list.cc
+++ b/chrome/browser/ui/browser_list.cc
@@ -26,6 +26,7 @@
#include "chrome/browser/chromeos/boot_times_loader.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/login_library.h"
+#include "chrome/browser/chromeos/wm_ipc.h"
#endif
namespace {
@@ -189,6 +190,7 @@ void BrowserList::NotifyAndTerminate() {
NotificationService::AllSources(),
NotificationService::NoDetails());
#if defined(OS_CHROMEOS)
+ chromeos::WmIpc::instance()->NotifyAboutSignout();
if (chromeos::CrosLibrary::Get()->EnsureLoaded()) {
chromeos::CrosLibrary::Get()->GetLoginLibrary()->StopSession("");
return;