diff options
Diffstat (limited to 'chrome/browser/idle_mac.mm')
-rw-r--r-- | chrome/browser/idle_mac.mm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/idle_mac.mm b/chrome/browser/idle_mac.mm index e1ab476..481bc37 100644 --- a/chrome/browser/idle_mac.mm +++ b/chrome/browser/idle_mac.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -85,8 +85,7 @@ void StopIdleMonitor() { } void CalculateIdleState(unsigned int idle_threshold, IdleCallback notify) { - if ([g_screenMonitor isScreensaverRunning] || - [g_screenMonitor isScreenLocked]) { + if (CheckIdleStateIsLocked()) { notify.Run(IDLE_STATE_LOCKED); return; } @@ -99,3 +98,8 @@ void CalculateIdleState(unsigned int idle_threshold, IdleCallback notify) { else notify.Run(IDLE_STATE_ACTIVE); } + +bool CheckIdleStateIsLocked() { + return [g_screenMonitor isScreensaverRunning] || + [g_screenMonitor isScreenLocked]; +} |