summaryrefslogtreecommitdiffstats
path: root/chromeos
diff options
context:
space:
mode:
authorrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 00:51:52 +0000
committerrkc@chromium.org <rkc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-23 00:51:52 +0000
commit5bcf62d7a637eac921984b07a4d2e91f2ab5894c (patch)
tree2fddbeae5c27c7eccffdaf94448dc6105b06edd2 /chromeos
parentf308ae4264d35a1e9a8e974cbcc41a88f200d2ab (diff)
downloadchromium_src-5bcf62d7a637eac921984b07a4d2e91f2ab5894c.zip
chromium_src-5bcf62d7a637eac921984b07a4d2e91f2ab5894c.tar.gz
chromium_src-5bcf62d7a637eac921984b07a4d2e91f2ab5894c.tar.bz2
Move retail mode's idle->active detection to Chrome.
Retail mode used power_manager to detect idle and active states; powerd now depends on Chrome letting it know of the user activity, which is rate limited to 5s. This introduces a delay in detecting any user activity for either the screensaver or the idle_logout dialog. Change the code to use Chrome's UserActivityDetector to detect user activity instead. Additionally the user activity detector is also rate limited to 1s; reduce this to 200s since it is a cheap operation. This CL also fixes a couple of other bugs that have made KioskMode unusable current builds. 1.) Get the profile for the user on the UI thread (this was being done on the file thread, causing a CalledOnValidThread check failure). 2.) Add a @ to the demo user since this is checked in gaia_auth_util.cc - CanonicalizeEmail. Not having the @ will cause a NOTREACHED. R=derat@chromium.org BUG=143706 TEST=The screensaver goes away as soon as the user presses a key or moves the mouse, even if it has been up for less than 5 seconds. Similarly, the idle logout dialog should cancel immidiately in case of any user activity. Review URL: https://chromiumcodereview.appspot.com/10868004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152895 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chromeos')
-rw-r--r--chromeos/dbus/power_manager_client.cc27
-rw-r--r--chromeos/dbus/power_manager_client.h7
2 files changed, 0 insertions, 34 deletions
diff --git a/chromeos/dbus/power_manager_client.cc b/chromeos/dbus/power_manager_client.cc
index fd78bc0..5721749 100644
--- a/chromeos/dbus/power_manager_client.cc
+++ b/chromeos/dbus/power_manager_client.cc
@@ -91,14 +91,6 @@ class PowerManagerClientImpl : public PowerManagerClient {
power_manager_proxy_->ConnectToSignal(
power_manager::kPowerManagerInterface,
- power_manager::kActiveNotifySignal,
- base::Bind(&PowerManagerClientImpl::ActiveNotifySignalReceived,
- weak_ptr_factory_.GetWeakPtr()),
- base::Bind(&PowerManagerClientImpl::SignalConnected,
- weak_ptr_factory_.GetWeakPtr()));
-
- power_manager_proxy_->ConnectToSignal(
- power_manager::kPowerManagerInterface,
power_manager::kSoftwareScreenDimmingRequestedSignal,
base::Bind(
&PowerManagerClientImpl::SoftwareScreenDimmingRequestedReceived,
@@ -218,10 +210,6 @@ class PowerManagerClientImpl : public PowerManagerClient {
dbus::ObjectProxy::EmptyResponseCallback());
}
- virtual void RequestActiveNotification() OVERRIDE {
- RequestIdleNotification(0);
- }
-
virtual void NotifyUserActivity(
const base::TimeTicks& last_activity_time) OVERRIDE {
dbus::MethodCall method_call(
@@ -485,20 +473,6 @@ class PowerManagerClientImpl : public PowerManagerClient {
FOR_EACH_OBSERVER(Observer, observers_, IdleNotify(threshold));
}
- void ActiveNotifySignalReceived(dbus::Signal* signal) {
- dbus::MessageReader reader(signal);
- int64 threshold = 0;
- if (!reader.PopInt64(&threshold)) {
- LOG(ERROR) << "Active Notify signal had incorrect parameters: "
- << signal->ToString();
- return;
- }
- DCHECK_EQ(threshold, 0);
-
- VLOG(1) << "Active Notify.";
- FOR_EACH_OBSERVER(Observer, observers_, ActiveNotify());
- }
-
void SoftwareScreenDimmingRequestedReceived(dbus::Signal* signal) {
dbus::MessageReader reader(signal);
int32 signal_state = 0;
@@ -612,7 +586,6 @@ class PowerManagerClientStubImpl : public PowerManagerClient {
}
virtual void RequestIdleNotification(int64 threshold) OVERRIDE {}
- virtual void RequestActiveNotification() OVERRIDE {}
virtual void NotifyUserActivity(
const base::TimeTicks& last_activity_time) OVERRIDE {}
virtual void NotifyVideoActivity(
diff --git a/chromeos/dbus/power_manager_client.h b/chromeos/dbus/power_manager_client.h
index f36572b..e910232 100644
--- a/chromeos/dbus/power_manager_client.h
+++ b/chromeos/dbus/power_manager_client.h
@@ -77,9 +77,6 @@ class CHROMEOS_EXPORT PowerManagerClient {
// Called when we go idle for threshold time.
virtual void IdleNotify(int64 threshold_secs) {}
- // Called when we go from idle to active.
- virtual void ActiveNotify() {}
-
// Called when a request is received to dim or undim the screen in software
// (as opposed to the more-common method of adjusting the backlight).
virtual void ScreenDimmingRequested(ScreenDimmingState state) {}
@@ -154,10 +151,6 @@ class CHROMEOS_EXPORT PowerManagerClient {
// time the machine goes idle for that much time, request again.
virtual void RequestIdleNotification(int64 threshold_secs) = 0;
- // Requests that the observers be notified in case of an Idle->Active event.
- // NOTE: Like the previous request, this will also get triggered exactly once.
- virtual void RequestActiveNotification() = 0;
-
// Notifies the power manager that the user is active (i.e. generating input
// events).
virtual void NotifyUserActivity(