Index: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc |
diff --git a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc |
index f69fc34e1081e0c7524371a3de5f3fae7a047132..4cfc1f4e0702688425f20e21aacb0dfcfddfbda4 100644 |
--- a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc |
+++ b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc |
@@ -11,10 +11,10 @@ |
#include "base/string_number_conversions.h" |
#include "base/utf_string_conversions.h" |
#include "base/values.h" |
-#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter.h" |
-#include "chrome/browser/chromeos/bluetooth/bluetooth_adapter_factory.h" |
-#include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" |
#include "content/public/browser/web_ui.h" |
+#include "device/bluetooth/bluetooth_adapter.h" |
+#include "device/bluetooth/bluetooth_adapter_factory.h" |
+#include "device/bluetooth/bluetooth_device.h" |
#include "grit/chromium_strings.h" |
#include "grit/generated_resources.h" |
#include "third_party/cros_system_api/dbus/service_constants.h" |
@@ -124,8 +124,9 @@ void BluetoothOptionsHandler::GetLocalizedValues( |
// TODO(kevers): Reorder methods to match ordering in the header file. |
-void BluetoothOptionsHandler::AdapterPresentChanged(BluetoothAdapter* adapter, |
- bool present) { |
+void BluetoothOptionsHandler::AdapterPresentChanged( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bool present) { |
DCHECK(adapter == adapter_.get()); |
if (present) { |
web_ui()->CallJavascriptFunction( |
@@ -140,8 +141,9 @@ void BluetoothOptionsHandler::AdapterPresentChanged(BluetoothAdapter* adapter, |
} |
} |
-void BluetoothOptionsHandler::AdapterPoweredChanged(BluetoothAdapter* adapter, |
- bool powered) { |
+void BluetoothOptionsHandler::AdapterPoweredChanged( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bool powered) { |
DCHECK(adapter == adapter_.get()); |
base::FundamentalValue checked(powered); |
web_ui()->CallJavascriptFunction( |
@@ -167,7 +169,8 @@ void BluetoothOptionsHandler::RegisterMessages() { |
} |
void BluetoothOptionsHandler::InitializeHandler() { |
- adapter_ = BluetoothAdapterFactory::DefaultAdapter(); |
+ adapter_ = bluetooth::BluetoothAdapterFactory::DefaultAdapter(); |
+ DCHECK(adapter_.get()); |
adapter_->AddObserver(this); |
} |
@@ -216,7 +219,7 @@ void BluetoothOptionsHandler::UpdateDeviceCallback( |
std::string address; |
args->GetString(kUpdateDeviceAddressIndex, &address); |
- BluetoothDevice* device = adapter_->GetDevice(address); |
+ bluetooth::BluetoothDevice* device = adapter_->GetDevice(address); |
if (!device) |
return; |
@@ -324,15 +327,15 @@ void BluetoothOptionsHandler::StopDiscoveryError() { |
void BluetoothOptionsHandler::GetPairedDevicesCallback( |
const ListValue* args) { |
- BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); |
+ bluetooth::BluetoothAdapter::DeviceList devices = adapter_->GetDevices(); |
- for (BluetoothAdapter::DeviceList::iterator iter = devices.begin(); |
+ for (bluetooth::BluetoothAdapter::DeviceList::iterator iter = devices.begin(); |
iter != devices.end(); ++iter) |
SendDeviceNotification(*iter, NULL); |
} |
void BluetoothOptionsHandler::SendDeviceNotification( |
- const BluetoothDevice* device, |
+ const bluetooth::BluetoothDevice* device, |
base::DictionaryValue* params) { |
base::DictionaryValue js_properties; |
js_properties.SetString("name", device->GetName()); |
@@ -348,36 +351,41 @@ void BluetoothOptionsHandler::SendDeviceNotification( |
js_properties); |
} |
-void BluetoothOptionsHandler::RequestPinCode(BluetoothDevice* device) { |
+void BluetoothOptionsHandler::RequestPinCode( |
+ bluetooth::BluetoothDevice* device) { |
DictionaryValue params; |
params.SetString("pairing", kEnterPinCode); |
SendDeviceNotification(device, ¶ms); |
} |
-void BluetoothOptionsHandler::RequestPasskey(BluetoothDevice* device) { |
+void BluetoothOptionsHandler::RequestPasskey( |
+ bluetooth::BluetoothDevice* device) { |
DictionaryValue params; |
params.SetString("pairing", kEnterPasskey); |
SendDeviceNotification(device, ¶ms); |
} |
-void BluetoothOptionsHandler::DisplayPinCode(BluetoothDevice* device, |
- const std::string& pincode) { |
+void BluetoothOptionsHandler::DisplayPinCode( |
+ bluetooth::BluetoothDevice* device, |
+ const std::string& pincode) { |
DictionaryValue params; |
params.SetString("pairing", kRemotePinCode); |
params.SetString("pincode", pincode); |
SendDeviceNotification(device, ¶ms); |
} |
-void BluetoothOptionsHandler::DisplayPasskey(BluetoothDevice* device, |
- uint32 passkey) { |
+void BluetoothOptionsHandler::DisplayPasskey( |
+ bluetooth::BluetoothDevice* device, |
+ uint32 passkey) { |
DictionaryValue params; |
params.SetString("pairing", kRemotePasskey); |
params.SetInteger("passkey", passkey); |
SendDeviceNotification(device, ¶ms); |
} |
-void BluetoothOptionsHandler::ConfirmPasskey(BluetoothDevice* device, |
- uint32 passkey) { |
+void BluetoothOptionsHandler::ConfirmPasskey( |
+ bluetooth::BluetoothDevice* device, |
+ uint32 passkey) { |
DictionaryValue params; |
params.SetString("pairing", kConfirmPasskey); |
params.SetInteger("passkey", passkey); |
@@ -400,22 +408,25 @@ void BluetoothOptionsHandler::ReportError( |
properties); |
} |
-void BluetoothOptionsHandler::DeviceAdded(BluetoothAdapter* adapter, |
- BluetoothDevice* device) { |
+void BluetoothOptionsHandler::DeviceAdded( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bluetooth::BluetoothDevice* device) { |
DCHECK(adapter == adapter_.get()); |
DCHECK(device); |
SendDeviceNotification(device, NULL); |
} |
-void BluetoothOptionsHandler::DeviceChanged(BluetoothAdapter* adapter, |
- BluetoothDevice* device) { |
+void BluetoothOptionsHandler::DeviceChanged( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bluetooth::BluetoothDevice* device) { |
DCHECK(adapter == adapter_.get()); |
DCHECK(device); |
SendDeviceNotification(device, NULL); |
} |
-void BluetoothOptionsHandler::DeviceRemoved(BluetoothAdapter* adapter, |
- BluetoothDevice* device) { |
+void BluetoothOptionsHandler::DeviceRemoved( |
+ bluetooth::BluetoothAdapter* adapter, |
+ bluetooth::BluetoothDevice* device) { |
DCHECK(adapter == adapter_.get()); |
DCHECK(device); |