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

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

Issue 876153002: device/bluetooth:Implement Register() for BluetoothAudioSinkChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_bluetooth_media_client.h" 5 #include "chromeos/dbus/fake_bluetooth_media_client.h"
6 6
7 namespace {
8
9 const char kNotImplementedError[] = "org.chromium.Error.NotImplemented";
armansito 2015/01/27 04:38:05 nit: don't indent variables within namespace.
Miao 2015/01/28 02:05:01 Done.
10 const char kInvalidArgumentError[] = "org.chromium.Error.InvalidArgument";
armansito 2015/01/27 04:38:05 nit: newline.
Miao 2015/01/28 02:05:01 Done.
11 } // namespace
12
7 namespace chromeos { 13 namespace chromeos {
8 14
9 FakeBluetoothMediaClient::FakeBluetoothMediaClient() { 15 FakeBluetoothMediaClient::FakeBluetoothMediaClient() {
10 } 16 }
11 17
12 FakeBluetoothMediaClient::~FakeBluetoothMediaClient() { 18 FakeBluetoothMediaClient::~FakeBluetoothMediaClient() {
13 } 19 }
14 20
15 void FakeBluetoothMediaClient::Init(dbus::Bus* bus) { 21 void FakeBluetoothMediaClient::Init(dbus::Bus* bus) {
16 } 22 }
17 23
18 void FakeBluetoothMediaClient::AddObserver( 24 void FakeBluetoothMediaClient::AddObserver(
19 BluetoothMediaClient::Observer* observer) { 25 BluetoothMediaClient::Observer* observer) {
20 DCHECK(observer); 26 DCHECK(observer);
21 observers_.AddObserver(observer); 27 observers_.AddObserver(observer);
22 } 28 }
23 29
24 void FakeBluetoothMediaClient::RemoveObserver( 30 void FakeBluetoothMediaClient::RemoveObserver(
25 BluetoothMediaClient::Observer* observer) { 31 BluetoothMediaClient::Observer* observer) {
26 DCHECK(observer); 32 DCHECK(observer);
27 observers_.RemoveObserver(observer); 33 observers_.RemoveObserver(observer);
28 } 34 }
29 35
30 // TODO(mcchou): Add method definition for |RegisterEndpoint|,
31 // |UnregisterEndpoint|, |RegisterPlayer| and |UnregisterPlayer|.
32 void FakeBluetoothMediaClient::RegisterEndpoint( 36 void FakeBluetoothMediaClient::RegisterEndpoint(
33 const dbus::ObjectPath& object_path, 37 const dbus::ObjectPath& object_path,
34 const dbus::ObjectPath& endpoint_path, 38 const dbus::ObjectPath& endpoint_path,
35 const EndpointProperties& properties, 39 const EndpointProperties& properties,
36 const base::Closure& callback, 40 const base::Closure& callback,
37 const ErrorCallback& error_callback) { 41 const ErrorCallback& error_callback) {
38 error_callback.Run("org.bluez.NotImplemented", ""); 42 VLOG(1) << "RegisterEndpoint: " << endpoint_path.value();
43 media_path_ = object_path;
armansito 2015/01/27 04:38:05 I'm not exactly sure what you're using |media_path
Miao 2015/01/28 02:05:01 Done.
44 if (properties.capabilities.empty()) {
armansito 2015/01/27 04:38:05 What about the |codec| and |uuid| fields?
Miao 2015/01/28 02:05:01 Done.
45 error_callback.Run(kInvalidArgumentError, "");
46 return;
47 }
48 callback.Run();
39 } 49 }
40 50
41 void FakeBluetoothMediaClient::UnregisterEndpoint( 51 void FakeBluetoothMediaClient::UnregisterEndpoint(
42 const dbus::ObjectPath& object_path, 52 const dbus::ObjectPath& object_path,
43 const dbus::ObjectPath& endpoint_path, 53 const dbus::ObjectPath& endpoint_path,
44 const base::Closure& callback, 54 const base::Closure& callback,
45 const ErrorCallback& error_callback) { 55 const ErrorCallback& error_callback) {
46 error_callback.Run("org.bluez.NotImplemented", ""); 56 error_callback.Run(kNotImplementedError, "");
47 } 57 }
48 58
49 } // namespace chromeos 59 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698