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

Unified Diff: chrome/browser/chromeos/bluetooth/bluetooth_manager.h

Issue 8394030: Chrome OS: Add bluetooth API for device discovery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address more satorux@ review comments Created 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/bluetooth/bluetooth_manager.h
diff --git a/chrome/browser/chromeos/bluetooth/bluetooth_manager.h b/chrome/browser/chromeos/bluetooth/bluetooth_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..fea96483bd0d0dbc6368df91d75084d17bab98da
--- /dev/null
+++ b/chrome/browser/chromeos/bluetooth/bluetooth_manager.h
@@ -0,0 +1,61 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_MANAGER_H_
+#define CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_MANAGER_H_
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/basictypes.h"
+
+namespace chromeos {
+
+class BluetoothAdapter;
+
+// BluetoothManager provides the Chrome OS bluetooth API.
+// This API is simplified relative to what's available via D-Bus.
+// We'll export additional functionality as needed.
+class BluetoothManager {
+ public:
+ // Interface for observing changes from the bluetooth manager.
+ class Observer {
+ public:
+ // Notification that the default adapter has changed. If |adapter| is NULL,
+ // it means that there are no longer any adapters.
+ // Clients should not cache this pointer.
+ virtual void DefaultAdapterChanged(BluetoothAdapter* adapter) {}
+ virtual ~Observer() {}
+ };
+
+ // Adds and removes the observer.
+ virtual void AddObserver(Observer* observer) = 0;
+ virtual void RemoveObserver(Observer* observer) = 0;
+
+ // Returns the default local bluetooth adapter or NULL if there is none.
+ // Clients should not cache this pointer.
+ virtual BluetoothAdapter* DefaultAdapter() = 0;
+
+ // Creates the global BluetoothManager instance.
+ static void Initialize();
+
+ // Destroys the global BluetoothManager instance if it exists.
+ static void Shutdown();
+
+ // Returns a pointer to the global BluetoothManager instance.
+ // Initialize() should already have been called.
+ static BluetoothManager* GetInstance();
+
+ protected:
+ BluetoothManager();
+ virtual ~BluetoothManager();
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(BluetoothManager);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_BLUETOOTH_BLUETOOTH_MANAGER_H_
« no previous file with comments | « chrome/browser/chromeos/bluetooth/bluetooth_device.cc ('k') | chrome/browser/chromeos/bluetooth/bluetooth_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698