OLD | NEW |
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_impl.h" | 5 #include "content/browser/power_save_blocker_impl.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/strings/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 content { | 15 namespace content { |
16 namespace { | 16 namespace { |
17 | 17 |
18 int g_blocker_count[2]; | 18 int g_blocker_count[2]; |
19 | 19 |
20 HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, const std::string& reason) { | 20 HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, const std::string& reason) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 base::Bind(&Delegate::ApplyBlock, delegate_)); | 165 base::Bind(&Delegate::ApplyBlock, delegate_)); |
166 } | 166 } |
167 | 167 |
168 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { | 168 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { |
169 BrowserThread::PostTask( | 169 BrowserThread::PostTask( |
170 BrowserThread::UI, FROM_HERE, | 170 BrowserThread::UI, FROM_HERE, |
171 base::Bind(&Delegate::RemoveBlock, delegate_)); | 171 base::Bind(&Delegate::RemoveBlock, delegate_)); |
172 } | 172 } |
173 | 173 |
174 } // namespace content | 174 } // namespace content |
OLD | NEW |