Index: chrome/browser/extensions/bluetooth_event_router.h |
diff --git a/chrome/browser/chromeos/extensions/bluetooth_event_router.h b/chrome/browser/extensions/bluetooth_event_router.h |
similarity index 61% |
rename from chrome/browser/chromeos/extensions/bluetooth_event_router.h |
rename to chrome/browser/extensions/bluetooth_event_router.h |
index 6715c4e374c1ca2c5e311f959463ff7f88f919d5..34cfdd13c8bdf8bc89651151d947b94228c32434 100644 |
--- a/chrome/browser/chromeos/extensions/bluetooth_event_router.h |
+++ b/chrome/browser/extensions/bluetooth_event_router.h |
@@ -2,30 +2,39 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
-#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
+#ifndef CHROME_BROWSER_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
+#define CHROME_BROWSER_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
#include <map> |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_vector.h" |
-#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" |
-#include "chrome/browser/chromeos/bluetooth/bluetooth_socket.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/extensions/api/experimental_bluetooth.h" |
+#include "device/bluetooth/bluetooth_adapter.h" |
+#include "device/bluetooth/bluetooth_socket.h" |
-namespace chromeos { |
+using bluetooth::BluetoothSocket; |
bryeung
2012/10/10 15:03:53
remove
youngki
2012/10/10 18:34:57
Done.
|
+ |
+namespace extensions { |
class ExtensionBluetoothEventRouter |
- : public chromeos::BluetoothAdapter::Observer { |
+ : public bluetooth::BluetoothAdapter::Observer { |
public: |
explicit ExtensionBluetoothEventRouter(Profile* profile); |
virtual ~ExtensionBluetoothEventRouter(); |
- const chromeos::BluetoothAdapter& adapter() const { return *adapter_.get(); } |
+ // adapter() will return NULL if the bluetooth adapter is not supported in the |
+ // current platform. |
+ const bluetooth::BluetoothAdapter* adapter() const { |
+ return adapter_.get(); |
+ } |
- // GetMutableAdapter will never return NULL. |
- chromeos::BluetoothAdapter* GetMutableAdapter() { return adapter_.get(); } |
+ // GetMutableAdapter will return NULL if the bluetooth adapter is not |
+ // supported in the current platform. |
+ bluetooth::BluetoothAdapter* GetMutableAdapter() { |
+ return adapter_.get(); |
+ } |
// Register the BluetoothSocket |socket| for use by the extensions system. |
// This class will hold onto the socket for its lifetime, or until |
@@ -52,18 +61,21 @@ class ExtensionBluetoothEventRouter |
const char* event_name, |
const extensions::api::experimental_bluetooth::Device& device); |
- // Override from chromeos::BluetoothAdapter::Observer |
- virtual void AdapterPresentChanged(chromeos::BluetoothAdapter* adapter, |
- bool present) OVERRIDE; |
- virtual void AdapterPoweredChanged(chromeos::BluetoothAdapter* adapter, |
- bool has_power) OVERRIDE; |
- virtual void AdapterDiscoveringChanged(chromeos::BluetoothAdapter* adapter, |
- bool discovering) OVERRIDE; |
- virtual void DeviceAdded(chromeos::BluetoothAdapter* adapter, |
- chromeos::BluetoothDevice* device) OVERRIDE; |
+ // Override from bluetooth::BluetoothAdapter::Observer |
+ virtual void AdapterPresentChanged( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bool present) OVERRIDE; |
+ virtual void AdapterPoweredChanged( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bool has_power) OVERRIDE; |
+ virtual void AdapterDiscoveringChanged( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bool discovering) OVERRIDE; |
+ virtual void DeviceAdded(bluetooth::BluetoothAdapter* adapter, |
+ bluetooth::BluetoothDevice* device) OVERRIDE; |
// Exposed for testing. |
- void SetAdapterForTest(chromeos::BluetoothAdapter* adapter) { |
+ void SetAdapterForTest(bluetooth::BluetoothAdapter* adapter) { |
adapter_ = adapter; |
} |
private: |
@@ -73,7 +85,7 @@ class ExtensionBluetoothEventRouter |
bool responsible_for_discovery_; |
Profile* profile_; |
- scoped_refptr<chromeos::BluetoothAdapter> adapter_; |
+ scoped_refptr<bluetooth::BluetoothAdapter> adapter_; |
// The next id to use for referring to a BluetoothSocket. We avoid using |
// the fd of the socket because we don't want to leak that information to |
@@ -90,6 +102,6 @@ class ExtensionBluetoothEventRouter |
DISALLOW_COPY_AND_ASSIGN(ExtensionBluetoothEventRouter); |
}; |
-} // namespace chromeos |
+} // namespace extensions |
-#endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |
+#endif // CHROME_BROWSER_EXTENSIONS_BLUETOOTH_EVENT_ROUTER_H_ |