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

Unified Diff: chrome/browser/chromeos/system/ash_system_tray_delegate.cc

Issue 10899037: Refactoring bluetooth API code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added #include <string> into bluetooth_adapter_dbus.cc. Created 8 years, 3 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/system/ash_system_tray_delegate.cc
diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
index ab8c512010a9e8879b7397f4a47b47a252cc5ded..9d1a27881a2fe373d9db084ba962905c982971cd 100644
--- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
+++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc
@@ -31,8 +31,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/accessibility_util.h"
#include "chrome/browser/chromeos/audio/audio_handler.h"
-#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h"
-#include "chrome/browser/chromeos/bluetooth/bluetooth_device.h"
+#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_dbus.h"
bryeung 2012/09/07 18:35:57 this should be using the generic interface
youngki 2012/09/13 18:05:02 Done.
+#include "chrome/browser/chromeos/bluetooth/bluetooth_device_dbus.h"
#include "chrome/browser/chromeos/cros/cros_library.h"
#include "chrome/browser/chromeos/cros/network_library.h"
#include "chrome/browser/chromeos/gdata/drive_service_interface.h"
@@ -156,7 +156,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
public content::NotificationObserver,
public input_method::InputMethodManager::Observer,
public system::TimezoneSettings::Observer,
- public BluetoothAdapter::Observer,
+ public BluetoothAdapterDBus::Observer,
public SystemKeyEventListener::CapsLockObserver,
public MessageBubbleLinkListener {
public:
@@ -215,7 +215,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
network_icon_->SetResourceColorTheme(NetworkMenuIcon::COLOR_LIGHT);
network_icon_dark_->SetResourceColorTheme(NetworkMenuIcon::COLOR_DARK);
- bluetooth_adapter_ = BluetoothAdapter::DefaultAdapter();
+ bluetooth_adapter_ = BluetoothAdapterDBus::DefaultAdapter();
bluetooth_adapter_->AddObserver(this);
}
@@ -361,9 +361,10 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
virtual void GetAvailableBluetoothDevices(
ash::BluetoothDeviceList* list) OVERRIDE {
- BluetoothAdapter::DeviceList devices = bluetooth_adapter_->GetDevices();
+ BluetoothAdapterDBus::DeviceList devices =
+ bluetooth_adapter_->GetDevices();
for (size_t i = 0; i < devices.size(); ++i) {
- BluetoothDevice* device = devices[i];
+ BluetoothDeviceInterface* device = devices[i];
if (!device->IsPaired())
continue;
ash::BluetoothDeviceInfo info;
@@ -375,7 +376,9 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
}
virtual void ToggleBluetoothConnection(const std::string& address) OVERRIDE {
- BluetoothDevice* device = bluetooth_adapter_->GetDevice(address);
+ BluetoothDeviceDBus* device =
+ static_cast<BluetoothDeviceDBus *>(
+ bluetooth_adapter_->GetDevice(address));
if (!device)
return;
if (device->IsConnected()) {
@@ -1136,35 +1139,35 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
NotifyRefreshClock();
}
- // Overridden from BluetoothAdapter::Observer.
- virtual void AdapterPresentChanged(BluetoothAdapter* adapter,
+ // Overridden from BluetoothAdapterDBus::Observer.
+ virtual void AdapterPresentChanged(BluetoothAdapterDBus* adapter,
bool present) OVERRIDE {
NotifyRefreshBluetooth();
}
- virtual void AdapterPoweredChanged(BluetoothAdapter* adapter,
+ virtual void AdapterPoweredChanged(BluetoothAdapterDBus* adapter,
bool powered) OVERRIDE {
NotifyRefreshBluetooth();
}
- virtual void AdapterDiscoveringChanged(BluetoothAdapter* adapter,
+ virtual void AdapterDiscoveringChanged(BluetoothAdapterDBus* adapter,
bool discovering) OVERRIDE {
// TODO: Perhaps start/stop throbbing the icon, or some other visual
// effects?
}
- virtual void DeviceAdded(BluetoothAdapter* adapter,
- BluetoothDevice* device) OVERRIDE {
+ virtual void DeviceAdded(BluetoothAdapterDBus* adapter,
+ BluetoothDeviceDBus* device) OVERRIDE {
NotifyRefreshBluetooth();
}
- virtual void DeviceChanged(BluetoothAdapter* adapter,
- BluetoothDevice* device) OVERRIDE {
+ virtual void DeviceChanged(BluetoothAdapterDBus* adapter,
+ BluetoothDeviceDBus* device) OVERRIDE {
NotifyRefreshBluetooth();
}
- virtual void DeviceRemoved(BluetoothAdapter* adapter,
- BluetoothDevice* device) OVERRIDE {
+ virtual void DeviceRemoved(BluetoothAdapterDBus* adapter,
+ BluetoothDeviceDBus* device) OVERRIDE {
NotifyRefreshBluetooth();
}
@@ -1231,7 +1234,7 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate,
ConnectionState connected_network_state_;
std::string connected_network_path_;
- scoped_refptr<BluetoothAdapter> bluetooth_adapter_;
+ scoped_refptr<BluetoothAdapterDBus> bluetooth_adapter_;
BooleanPrefMember accessibility_enabled_;

Powered by Google App Engine
This is Rietveld 408576698