diff options
author | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-09 20:32:18 +0000 |
---|---|---|
committer | derat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-07-09 20:32:18 +0000 |
commit | 16f3e30d213bd3708591d6a513889e395c485ac8 (patch) | |
tree | 2bdf875eb28b8ecdb6f79cd2600799cad5502376 /chromeos/dbus/session_manager_client.h | |
parent | c6f57f9e22339c7beb608a67ac9bb90425ed84e6 (diff) | |
download | chromium_src-16f3e30d213bd3708591d6a513889e395c485ac8.zip chromium_src-16f3e30d213bd3708591d6a513889e395c485ac8.tar.gz chromium_src-16f3e30d213bd3708591d6a513889e395c485ac8.tar.bz2 |
chromeos: Request screen lock directly from session manager.
Screen lock and unlock requests were previously sent to
powerd, which just forwarded them on to the session manager
without doing anything extra. It's simpler for Chrome to
just ask the session manager to lock or unlock directly.
I'm also moving the LockScreen and UnlockScreen
notifications from PowerManagerClient::Observer to
SessionManagerClient::Observer. Confusingly, the signals
that prompt those notifications are sent by the session
manager but were being listened for in PowerManagerClient.
BUG=chromium-os:24003
TEST=manual: able to lock the screen from the UI, power button, and by closing the lid; unlocking works too
Review URL: https://chromiumcodereview.appspot.com/10693087
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145737 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos/dbus/session_manager_client.h')
-rw-r--r-- | chromeos/dbus/session_manager_client.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chromeos/dbus/session_manager_client.h b/chromeos/dbus/session_manager_client.h index 82382e3..aed121e 100644 --- a/chromeos/dbus/session_manager_client.h +++ b/chromeos/dbus/session_manager_client.h @@ -26,13 +26,22 @@ class CHROMEOS_EXPORT SessionManagerClient { public: // Called when the owner key is set. virtual void OwnerKeySet(bool success) {} + // Called when the property change is complete. virtual void PropertyChangeComplete(bool success) {} + + // Called when the screen is locked. + virtual void LockScreen() {} + + // Called when the screen is unlocked. + virtual void UnlockScreen() {} + }; // Adds and removes the observer. virtual void AddObserver(Observer* observer) = 0; virtual void RemoveObserver(Observer* observer) = 0; + virtual bool HasObserver(Observer* observer) = 0; // Kicks off an attempt to emit the "login-prompt-ready" upstart signal. virtual void EmitLoginPromptReady() = 0; @@ -53,6 +62,17 @@ class CHROMEOS_EXPORT SessionManagerClient { // Stops the current session. virtual void StopSession() = 0; + // Locks the screen. + virtual void RequestLockScreen() = 0; + + // Unlocks the screen. + virtual void RequestUnlockScreen() = 0; + + // Returns whether or not the screen is locked. Implementation should cache + // this state so that it can return immediately. Useful for observers that + // need to know the current screen lock state when they are added. + virtual bool GetIsScreenLocked() = 0; + // Used for RetrieveDevicePolicy and RetrieveUserPolicy. Takes a serialized // protocol buffer as string. Upon success, we will pass a protobuf to the // callback. On failure, we will pass "". |