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 "device/power_save_blocker/power_save_blocker.h" | 5 #include "device/power_save_blocker/power_save_blocker.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/sequenced_task_runner.h" |
12 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
13 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" |
14 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
15 | 16 |
16 namespace device { | 17 namespace device { |
17 namespace { | 18 namespace { |
18 | 19 |
19 int g_blocker_count[2]; | 20 int g_blocker_count[2]; |
20 | 21 |
21 HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, | 22 HANDLE CreatePowerRequest(POWER_REQUEST_TYPE type, |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 ui_task_runner_->PostTask(FROM_HERE, | 152 ui_task_runner_->PostTask(FROM_HERE, |
152 base::Bind(&Delegate::ApplyBlock, delegate_)); | 153 base::Bind(&Delegate::ApplyBlock, delegate_)); |
153 } | 154 } |
154 | 155 |
155 PowerSaveBlocker::~PowerSaveBlocker() { | 156 PowerSaveBlocker::~PowerSaveBlocker() { |
156 ui_task_runner_->PostTask(FROM_HERE, | 157 ui_task_runner_->PostTask(FROM_HERE, |
157 base::Bind(&Delegate::RemoveBlock, delegate_)); | 158 base::Bind(&Delegate::RemoveBlock, delegate_)); |
158 } | 159 } |
159 | 160 |
160 } // namespace device | 161 } // namespace device |
OLD | NEW |