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

Side by Side Diff: content/browser/power_save_blocker_win.cc

Issue 10696116: Remove useless code in power_save_blocker_win.cc after changing to Win8 SDK. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/power_save_blocker.h" 5 #include "content/browser/power_save_blocker.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "base/win/scoped_handle.h" 11 #include "base/win/scoped_handle.h"
12 #include "base/win/windows_version.h" 12 #include "base/win/windows_version.h"
13 #include "content/public/browser/browser_thread.h" 13 #include "content/public/browser/browser_thread.h"
14 14
15 namespace { 15 namespace {
16 16
17 int g_blocker_count[2]; 17 int g_blocker_count[2];
18 18
19 #if _WIN32_WINNT <= _WIN32_WINNT_WIN7
20 POWER_REQUEST_TYPE PowerRequestExecutionRequired =
21 static_cast<POWER_REQUEST_TYPE>(PowerRequestAwayModeRequired + 1);
22 #endif
23
24 HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, const std::string& reason) { 19 HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, const std::string& reason) {
25 typedef HANDLE (WINAPI* PowerCreateRequestPtr)(PREASON_CONTEXT); 20 typedef HANDLE (WINAPI* PowerCreateRequestPtr)(PREASON_CONTEXT);
26 typedef BOOL (WINAPI* PowerSetRequestPtr)(HANDLE, POWER_REQUEST_TYPE); 21 typedef BOOL (WINAPI* PowerSetRequestPtr)(HANDLE, POWER_REQUEST_TYPE);
27 22
28 if (type == PowerRequestExecutionRequired && 23 if (type == PowerRequestExecutionRequired &&
29 base::win::GetVersion() < base::win::VERSION_WIN8) { 24 base::win::GetVersion() < base::win::VERSION_WIN8) {
30 return INVALID_HANDLE_VALUE; 25 return INVALID_HANDLE_VALUE;
31 } 26 }
32 27
33 static PowerCreateRequestPtr PowerCreateRequestFn = NULL; 28 static PowerCreateRequestPtr PowerCreateRequestFn = NULL;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 base::Bind(&Delegate::ApplyBlock, delegate_)); 166 base::Bind(&Delegate::ApplyBlock, delegate_));
172 } 167 }
173 168
174 PowerSaveBlocker::~PowerSaveBlocker() { 169 PowerSaveBlocker::~PowerSaveBlocker() {
175 BrowserThread::PostTask( 170 BrowserThread::PostTask(
176 BrowserThread::UI, FROM_HERE, 171 BrowserThread::UI, FROM_HERE,
177 base::Bind(&Delegate::RemoveBlock, delegate_)); 172 base::Bind(&Delegate::RemoveBlock, delegate_));
178 } 173 }
179 174
180 } // namespace content 175 } // namespace content
OLDNEW
« 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