| Index: chrome/browser/idle_linux.cc
|
| diff --git a/chrome/browser/idle_linux.cc b/chrome/browser/idle_linux.cc
|
| index eba79585d54d76b4710fd933b7066d9936a2d006..dacde8bae13342afb149580e7c78ee1b25c91c19 100644
|
| --- a/chrome/browser/idle_linux.cc
|
| +++ b/chrome/browser/idle_linux.cc
|
| @@ -64,16 +64,10 @@ bool ScreensaverWindowExists() {
|
| }
|
|
|
| void CalculateIdleState(unsigned int idle_threshold, IdleCallback notify) {
|
| - // Usually the screensaver is used to lock the screen, so we do not need to
|
| - // check if the workstation is locked.
|
| - gdk_error_trap_push();
|
| - bool result = ScreensaverWindowExists();
|
| - bool got_error = gdk_error_trap_pop();
|
| - if (result && !got_error) {
|
| + if (CheckIdleStateIsLocked()) {
|
| notify.Run(IDLE_STATE_LOCKED);
|
| return;
|
| }
|
| -
|
| browser::IdleQueryLinux idle_query;
|
| unsigned int idle_time = idle_query.IdleTime();
|
| if (idle_time >= idle_threshold)
|
| @@ -81,3 +75,12 @@ void CalculateIdleState(unsigned int idle_threshold, IdleCallback notify) {
|
| else
|
| notify.Run(IDLE_STATE_ACTIVE);
|
| }
|
| +
|
| +bool CheckIdleStateIsLocked() {
|
| + // Usually the screensaver is used to lock the screen, so we do not need to
|
| + // check if the workstation is locked.
|
| + gdk_error_trap_push();
|
| + bool result = ScreensaverWindowExists();
|
| + bool got_error = gdk_error_trap_pop();
|
| + return result && !got_error;
|
| +}
|
|
|