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

Side by Side Diff: chrome/browser/chromeos/dbus/bluetooth_manager_client.h

Issue 9838085: Move files inside chrome/browser/chromeos/dbus to chromeos/dbus (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: _ Created 8 years, 9 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_
6 #define CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/callback.h"
12 #include "base/observer_list.h"
13 #include "chrome/browser/chromeos/dbus/bluetooth_property.h"
14 #include "dbus/object_path.h"
15
16 namespace dbus {
17 class Bus;
18 } // namespace dbus
19
20 namespace chromeos {
21
22 // BluetoothManagerClient is used to communicate with the bluetooth
23 // daemon's Manager interface.
24 class BluetoothManagerClient {
25 public:
26 // Structure of properties associated with the bluetooth manager.
27 struct Properties : public BluetoothPropertySet {
28 // List of object paths of local Bluetooth adapters. Read-only.
29 BluetoothProperty<std::vector<dbus::ObjectPath> > adapters;
30
31 Properties(dbus::ObjectProxy* object_proxy,
32 PropertyChangedCallback callback);
33 virtual ~Properties();
34 };
35
36 // Interface for observing changes from the bluetooth manager.
37 class Observer {
38 public:
39 virtual ~Observer() {}
40
41 // Called when the manager has a change in value of the property
42 // named |property_name|.
43 virtual void ManagerPropertyChanged(const std::string& property_name) {}
44
45 // Called when a local bluetooth adapter is added.
46 // |object_path| is the dbus object path of the adapter.
47 virtual void AdapterAdded(const dbus::ObjectPath& object_path) {}
48
49 // Called when a local bluetooth adapter is removed.
50 // |object_path| is the dbus object path of the adapter.
51 virtual void AdapterRemoved(const dbus::ObjectPath& object_path) {}
52
53 // Called when the default local bluetooth adapter changes.
54 // |object_path| is the dbus object path of the new default adapter.
55 // Not called if all adapters are removed.
56 virtual void DefaultAdapterChanged(const dbus::ObjectPath& object_path) {}
57 };
58
59 virtual ~BluetoothManagerClient();
60
61 // Adds and removes observers.
62 virtual void AddObserver(Observer* observer) = 0;
63 virtual void RemoveObserver(Observer* observer) = 0;
64
65 // Obtain the properties for the manager, any values should be copied
66 // if needed.
67 virtual Properties* GetProperties() = 0;
68
69 // The AdapterCallback is used for both the DefaultAdapter() and
70 // FindAdapter() methods. It receives two arguments, the |object_path|
71 // of the adapter and |success| which indicates whether or not the request
72 // succeeded.
73 typedef base::Callback<void(const dbus::ObjectPath&, bool)> AdapterCallback;
74
75 // Retrieves the dbus object path for the default adapter.
76 // The default adapter is the preferred local bluetooth interface when a
77 // client does not specify a particular interface.
78 virtual void DefaultAdapter(const AdapterCallback& callback) = 0;
79
80 // Retrieves the dbus object path for the adapter with the address |address|,
81 // which may also be an interface name.
82 virtual void FindAdapter(const std::string& address,
83 const AdapterCallback& callback) = 0;
84
85 // Creates the instance.
86 static BluetoothManagerClient* Create(dbus::Bus* bus);
87
88 protected:
89 BluetoothManagerClient();
90
91 private:
92 DISALLOW_COPY_AND_ASSIGN(BluetoothManagerClient);
93 };
94
95 } // namespace chromeos
96
97 #endif // CHROME_BROWSER_CHROMEOS_DBUS_BLUETOOTH_MANAGER_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698