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

Side by Side Diff: device/bluetooth/dbus/bluez_dbus_manager.h

Issue 1367663002: Add Linux support for the Bluetooth API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_dbus
Patch Set: rebase Created 5 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) 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 #ifndef DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_MANAGER_H_ 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_MANAGER_H_
6 #define DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_MANAGER_H_ 6 #define DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_MANAGER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // shutdown. However, to be extra cautious, clients should use 49 // shutdown. However, to be extra cautious, clients should use
50 // WeakPtrFactory when creating callbacks that run on UI thread. See 50 // WeakPtrFactory when creating callbacks that run on UI thread. See
51 // session_manager_client.cc for examples. 51 // session_manager_client.cc for examples.
52 // 52 //
53 class DEVICE_BLUETOOTH_EXPORT BluezDBusManager { 53 class DEVICE_BLUETOOTH_EXPORT BluezDBusManager {
54 public: 54 public:
55 // Sets the global instance. Must be called before any calls to Get(). 55 // Sets the global instance. Must be called before any calls to Get().
56 // We explicitly initialize and shut down the global object, rather than 56 // We explicitly initialize and shut down the global object, rather than
57 // making it a Singleton, to ensure clean startup and shutdown. 57 // making it a Singleton, to ensure clean startup and shutdown.
58 // This will initialize real or stub DBusClients depending on command-line 58 // This will initialize real or stub DBusClients depending on command-line
59 // arguments and whether this process runs in a ChromeOS environment. 59 // arguments and whether this process runs in a real or test environment.
60 static void Initialize(dbus::Bus* bus, bool use_dbus_stub); 60 static void Initialize(dbus::Bus* bus, bool use_dbus_stub);
61 61
62 // Returns a BluezDBusManagerSetter instance that allows tests to 62 // Returns a BluezDBusManagerSetter instance that allows tests to
63 // replace individual D-Bus clients with their own implementations. 63 // replace individual D-Bus clients with their own implementations.
64 // Also initializes the main BluezDBusManager for testing if necessary. 64 // Also initializes the main BluezDBusManager for testing if necessary.
65 static scoped_ptr<BluezDBusManagerSetter> GetSetterForTesting(); 65 static scoped_ptr<BluezDBusManagerSetter> GetSetterForTesting();
66 66
67 // Returns true if BluezDBusManager has been initialized. Call this to 67 // Returns true if BluezDBusManager has been initialized. Call this to
68 // avoid initializing + shutting down BluezDBusManager more than once. 68 // avoid initializing + shutting down BluezDBusManager more than once.
69 static bool IsInitialized(); 69 static bool IsInitialized();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 friend class BluezDBusManager; 148 friend class BluezDBusManager;
149 149
150 BluezDBusManagerSetter(); 150 BluezDBusManagerSetter();
151 151
152 DISALLOW_COPY_AND_ASSIGN(BluezDBusManagerSetter); 152 DISALLOW_COPY_AND_ASSIGN(BluezDBusManagerSetter);
153 }; 153 };
154 154
155 } // namespace bluez 155 } // namespace bluez
156 156
157 #endif // DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_MANAGER_H_ 157 #endif // DEVICE_BLUETOOTH_DBUS_BLUEZ_DBUS_MANAGER_H_
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/bluetooth_profile_service_provider.h ('k') | device/bluetooth/dbus/dbus_thread_manager_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698