Chromium Code Reviews| 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..99ca95b5a0db9f366d62fc1c3016719d7d3ce5ce 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, |
| + weak_ptr_factory_.GetWeakPtr())); |
| } |
| void BluetoothOptionsHandler::InitializePage() { |
| @@ -198,6 +198,13 @@ void BluetoothOptionsHandler::InitializePage() { |
| "options.BluetoothOptions.updateDiscovery"); |
| } |
| +void BluetoothOptionsHandler::InitializeAdapter( |
| + scoped_refptr<device::BluetoothAdapter> adapter) { |
| + adapter_ = adapter; |
| + CHECK(adapter_); |
|
Nikita (slow)
2013/01/10 10:29:55
Same question here.
youngki
2013/01/10 18:58:54
Here is the same as well.
|
| + adapter_->AddObserver(this); |
| +} |
| + |
| void BluetoothOptionsHandler::EnableChangeCallback( |
| const ListValue* args) { |
| bool bluetooth_enabled; |