Add support to auto-shutdown on lid close if no one is logged in

Since there should be no background processing going on and boot is fast, we
shouldn't waste battery sleeping when no one is logged in.  This is implemented
using simple state files and upstart events. It is simplistic but minimizes
suspend dependencies at the cost of some minor login+lid-close raciness.

As a side benefit, this ensures that if a user types in a passphrase, then
shuts the lid before pressing enter, the password won't stay resident in the
password box for the next person that opens it.

BUG=1780
TEST=none

Review URL: http://codereview.chromium.org/671023
1 file changed