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

Unified Diff: content/browser/power_save_blocker_win.cc

Issue 10542064: Content: fix the power save blocker for Win7. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/power_save_blocker_win.cc
===================================================================
--- content/browser/power_save_blocker_win.cc (revision 140668)
+++ content/browser/power_save_blocker_win.cc (working copy)
@@ -165,8 +165,7 @@
void PowerSaveBlocker::Delegate::ApplyBlock() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- base::win::Version os_version = base::win::GetVersion();
- if (os_version < base::win::VERSION_WIN7)
+ if (base::win::GetVersion() < base::win::VERSION_WIN7)
return ApplySimpleBlock(type_, 1);
handle_.Set(CreatePowerRequest(RequestType(), reason_));
@@ -174,8 +173,7 @@
void PowerSaveBlocker::Delegate::RemoveBlock() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- base::win::Version os_version = base::win::GetVersion();
- if (os_version < base::win::VERSION_WIN7)
+ if (base::win::GetVersion() < base::win::VERSION_WIN7)
return ApplySimpleBlock(type_, -1);
DeletePowerRequest(RequestType(), handle_.Take());
@@ -185,6 +183,9 @@
if (type_ == kPowerSaveBlockPreventDisplaySleep)
return PowerRequestDisplayRequired;
+ if (base::win::GetVersion() < base::win::VERSION_WIN8)
+ return PowerRequestSystemRequired;
+
return PowerRequestExecutionRequired;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698