Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / chromeos / dbus / fake_amplifier_client.cc
blobab8129d41905327c304abf9bd82ae681833a713e
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chromeos/dbus/fake_amplifier_client.h"
7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h"
10 namespace chromeos {
12 namespace {
14 void OnBoolDBusMethod(const BoolDBusMethodCallback& callback) {
15 callback.Run(DBUS_METHOD_CALL_SUCCESS, true);
18 void OnVoidDBusMethod(const VoidDBusMethodCallback& callback) {
19 callback.Run(DBUS_METHOD_CALL_SUCCESS);
22 } // anonymous namespace
24 FakeAmplifierClient::FakeAmplifierClient() {
27 FakeAmplifierClient::~FakeAmplifierClient() {
30 void FakeAmplifierClient::Init(dbus::Bus* bus) {
33 void FakeAmplifierClient::AddObserver(Observer* observer) {
36 void FakeAmplifierClient::RemoveObserver(Observer* observer) {
39 void FakeAmplifierClient::Initialize(const BoolDBusMethodCallback& callback) {
40 base::MessageLoop::current()->PostTask(
41 FROM_HERE, base::Bind(&OnBoolDBusMethod, callback));
44 void FakeAmplifierClient::SetStandbyMode(
45 bool standby,
46 const VoidDBusMethodCallback& callback) {
47 base::MessageLoop::current()->PostTask(
48 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback));
51 void FakeAmplifierClient::SetVolume(double db_spl,
52 const VoidDBusMethodCallback& callback) {
53 base::MessageLoop::current()->PostTask(
54 FROM_HERE, base::Bind(&OnVoidDBusMethod, callback));
57 } // namespace chromeos