Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: chrome/browser/idle_mac.mm

Issue 7864022: Fixing the bug, that caused UI to hang after unsupported device was inserted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: small fixes Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/idle_mac.mm
diff --git a/chrome/browser/idle_mac.mm b/chrome/browser/idle_mac.mm
index e1ab476dc12484558218c0ccb1932dc48938659e..53612a0129178f124de4aa941fd2235bcb34d452 100644
--- a/chrome/browser/idle_mac.mm
+++ b/chrome/browser/idle_mac.mm
@@ -85,8 +85,7 @@ void StopIdleMonitor() {
}
void CalculateIdleState(unsigned int idle_threshold, IdleCallback notify) {
- if ([g_screenMonitor isScreensaverRunning] ||
- [g_screenMonitor isScreenLocked]) {
+ if (IsWorkstationInLockedState()) {
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 IsWorkstationInLockedState() {
+ return [g_screenMonitor isScreensaverRunning] ||
+ [g_screenMonitor isScreenLocked];
tonibarzic 2011/09/10 00:37:40 align with [ in the row above
sidor 2011/09/10 02:18:28 Won't fit.
+}

Powered by Google App Engine
This is Rietveld 408576698