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 "device/power_save_blocker/power_save_blocker_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "chromeos/dbus/power_policy_controller.h" | 14 #include "chromeos/dbus/power_policy_controller.h" |
15 | 15 |
16 namespace content { | 16 namespace device { |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Converts a PowerSaveBlocker::Reason to a | 20 // Converts a PowerSaveBlocker::Reason to a |
21 // chromeos::PowerPolicyController::WakeLockReason. | 21 // chromeos::PowerPolicyController::WakeLockReason. |
22 chromeos::PowerPolicyController::WakeLockReason GetWakeLockReason( | 22 chromeos::PowerPolicyController::WakeLockReason GetWakeLockReason( |
23 PowerSaveBlocker::Reason reason) { | 23 PowerSaveBlocker::Reason reason) { |
24 switch (reason) { | 24 switch (reason) { |
25 case PowerSaveBlocker::kReasonAudioPlayback: | 25 case PowerSaveBlocker::kReasonAudioPlayback: |
26 return chromeos::PowerPolicyController::REASON_AUDIO_PLAYBACK; | 26 return chromeos::PowerPolicyController::REASON_AUDIO_PLAYBACK; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 blocking_task_runner_(blocking_task_runner) { | 102 blocking_task_runner_(blocking_task_runner) { |
103 ui_task_runner_->PostTask(FROM_HERE, | 103 ui_task_runner_->PostTask(FROM_HERE, |
104 base::Bind(&Delegate::ApplyBlock, delegate_)); | 104 base::Bind(&Delegate::ApplyBlock, delegate_)); |
105 } | 105 } |
106 | 106 |
107 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { | 107 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { |
108 ui_task_runner_->PostTask(FROM_HERE, | 108 ui_task_runner_->PostTask(FROM_HERE, |
109 base::Bind(&Delegate::RemoveBlock, delegate_)); | 109 base::Bind(&Delegate::RemoveBlock, delegate_)); |
110 } | 110 } |
111 | 111 |
112 } // namespace content | 112 } // namespace device |
OLD | NEW |