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

Side by Side Diff: chromeos/dbus/fake_power_manager_client.cc

Issue 2409983006: Make [S,G]getBacklightsForcedOff dbus API integrated to power_manager_client (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "chromeos/dbus/fake_power_manager_client.h" 5 #include "chromeos/dbus/fake_power_manager_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 !source.active_by_default() || source.max_power() < kUsbMinAcWatts 127 !source.active_by_default() || source.max_power() < kUsbMinAcWatts
128 ? power_manager::PowerSupplyProperties_ExternalPower_USB 128 ? power_manager::PowerSupplyProperties_ExternalPower_USB
129 : power_manager::PowerSupplyProperties_ExternalPower_AC); 129 : power_manager::PowerSupplyProperties_ExternalPower_AC);
130 break; 130 break;
131 } 131 }
132 } 132 }
133 133
134 NotifyObservers(); 134 NotifyObservers();
135 } 135 }
136 136
137 void FakePowerManagerClient::SetBacklightsForcedOff(bool is_off) {}
138
139 void FakePowerManagerClient::GetBacklightsForcedOffState(
140 const GetBacklightsForcedOffStateCallback& callback) {}
Daniel Erat 2016/10/13 17:25:19 mind stubbing the implementation of this to make i
Qiang(Joe) Xu 2016/10/13 21:19:40 Done.
141
137 base::Closure FakePowerManagerClient::GetSuspendReadinessCallback() { 142 base::Closure FakePowerManagerClient::GetSuspendReadinessCallback() {
138 ++num_pending_suspend_readiness_callbacks_; 143 ++num_pending_suspend_readiness_callbacks_;
139 144
140 return base::Bind(&FakePowerManagerClient::HandleSuspendReadiness, 145 return base::Bind(&FakePowerManagerClient::HandleSuspendReadiness,
141 base::Unretained(this)); 146 base::Unretained(this));
142 } 147 }
143 148
144 int FakePowerManagerClient::GetNumPendingSuspendReadinessCallbacks() { 149 int FakePowerManagerClient::GetNumPendingSuspendReadinessCallbacks() {
145 return num_pending_suspend_readiness_callbacks_; 150 return num_pending_suspend_readiness_callbacks_;
146 } 151 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 FOR_EACH_OBSERVER(Observer, observers_, PowerChanged(props_)); 191 FOR_EACH_OBSERVER(Observer, observers_, PowerChanged(props_));
187 } 192 }
188 193
189 void FakePowerManagerClient::HandleSuspendReadiness() { 194 void FakePowerManagerClient::HandleSuspendReadiness() {
190 CHECK(num_pending_suspend_readiness_callbacks_ > 0); 195 CHECK(num_pending_suspend_readiness_callbacks_ > 0);
191 196
192 --num_pending_suspend_readiness_callbacks_; 197 --num_pending_suspend_readiness_callbacks_;
193 } 198 }
194 199
195 } // namespace chromeos 200 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698