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

Unified Diff: chrome/browser/idle_win.cc

Issue 140453002: Repaint windows on screen unlock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | « no previous file | ui/base/win/lock_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/idle_win.cc
diff --git a/chrome/browser/idle_win.cc b/chrome/browser/idle_win.cc
index 3c6c7d51907213ccb56110845190599b8e57dc5a..0457ed9948fb4520d90808cfe7e7c4e753f4a72b 100644
--- a/chrome/browser/idle_win.cc
+++ b/chrome/browser/idle_win.cc
@@ -7,6 +7,8 @@
#include <limits.h>
#include <windows.h>
+#include "ui/base/win/lock_state.h"
+
namespace {
DWORD CalculateIdleTimeInternal() {
@@ -41,24 +43,6 @@ bool IsScreensaverRunning() {
return false;
}
-bool IsWorkstationLocked() {
- bool is_locked = true;
- HDESK input_desk = ::OpenInputDesktop(0, 0, GENERIC_READ);
- if (input_desk) {
- wchar_t name[256] = {0};
- DWORD needed = 0;
- if (::GetUserObjectInformation(input_desk,
- UOI_NAME,
- name,
- sizeof(name),
- &needed)) {
- is_locked = lstrcmpi(name, L"default") != 0;
- }
- ::CloseDesktop(input_desk);
- }
- return is_locked;
-}
-
} // namespace
void CalculateIdleTime(IdleTimeCallback notify) {
@@ -66,5 +50,5 @@ void CalculateIdleTime(IdleTimeCallback notify) {
}
bool CheckIdleStateIsLocked() {
- return IsWorkstationLocked() || IsScreensaverRunning();
+ return ui::IsWorkstationLocked() || IsScreensaverRunning();
}
« no previous file with comments | « no previous file | ui/base/win/lock_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698