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

Unified Diff: content/browser/power_save_blocker_win.cc

Issue 8251008: Add screen power save block level. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 9 years, 2 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: content/browser/power_save_blocker_win.cc
diff --git a/content/browser/power_save_blocker_win.cc b/content/browser/power_save_blocker_win.cc
index 1ea3ac99aa9deb317d66402180137b25c14e14c8..1a7ce93a3642ac855e1d242f3381e88e45689152 100644
--- a/content/browser/power_save_blocker_win.cc
+++ b/content/browser/power_save_blocker_win.cc
@@ -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.
@@ -8,14 +8,23 @@
#include "content/browser/browser_thread.h"
-// Runs on UI thread only.
-void PowerSaveBlocker::ApplyBlock(bool blocking) {
+// Called only from UI thread.
+// static
+void PowerSaveBlocker::ApplyBlock(PowerSaveBlockerType type) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DWORD flags = ES_CONTINUOUS;
- if (blocking)
- flags |= ES_SYSTEM_REQUIRED;
+ switch (type) {
+ case kPowerSaveBlockPreventSystemSleep:
+ flags |= ES_SYSTEM_REQUIRED;
+ break;
+ case kPowerSaveBlockPreventDisplaySleep:
+ flags |= ES_DISPLAY_REQUIRED;
+ break;
+ default:
+ break;
+ }
SetThreadExecutionState(flags);
}
« content/browser/power_save_blocker.h ('K') | « content/browser/power_save_blocker_stub.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698