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

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: style 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
« no previous file with comments | « chrome/browser/idle_linux.cc ('k') | chrome/browser/idle_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/idle_mac.mm
diff --git a/chrome/browser/idle_mac.mm b/chrome/browser/idle_mac.mm
index e1ab476dc12484558218c0ccb1932dc48938659e..b1c30941a55a7b22d75b67d467ac63d51e6fa739 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 (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];
+}
« no previous file with comments | « chrome/browser/idle_linux.cc ('k') | chrome/browser/idle_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698