| 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 c2df792f7e484e31ec0e9a5c7ce778c0d1c45f34..256594cf08bbfdb1797872cc80497dce633c2193 100644
|
| --- a/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc
|
| @@ -183,9 +183,9 @@ void BluetoothOptionsHandler::RegisterMessages() {
|
| }
|
|
|
| void BluetoothOptionsHandler::InitializeHandler() {
|
| - adapter_ = device::BluetoothAdapterFactory::DefaultAdapter();
|
| - DCHECK(adapter_.get());
|
| - adapter_->AddObserver(this);
|
| + device::BluetoothAdapterFactory::RunCallbackOnAdapterReady(
|
| + base::Bind(&BluetoothOptionsHandler::InitializeAdapter,
|
| + base::Unretained(this)));
|
| }
|
|
|
| void BluetoothOptionsHandler::InitializePage() {
|
| @@ -198,6 +198,14 @@ void BluetoothOptionsHandler::InitializePage() {
|
| "options.BluetoothOptions.updateDiscovery");
|
| }
|
|
|
| +bool BluetoothOptionsHandler::InitializeAdapter(
|
| + scoped_refptr<device::BluetoothAdapter> adapter) {
|
| + adapter_ = adapter;
|
| + DCHECK(adapter_.get());
|
| + adapter_->AddObserver(this);
|
| + return true;
|
| +}
|
| +
|
| void BluetoothOptionsHandler::EnableChangeCallback(
|
| const ListValue* args) {
|
| bool bluetooth_enabled;
|
|
|