Chromium Code Reviews| 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 64ef92c61d8c01a46d949570c467563157749761..b666d5cb76e1199c78f0a356e87b031099439e22 100644 |
| --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc |
| +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc |
| @@ -270,7 +270,15 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, |
| network_icon_->SetResourceColorTheme(NetworkMenuIcon::COLOR_LIGHT); |
| network_icon_dark_->SetResourceColorTheme(NetworkMenuIcon::COLOR_DARK); |
| - bluetooth_adapter_ = device::BluetoothAdapterFactory::DefaultAdapter(); |
| + device::BluetoothAdapterFactory::RunCallbackOnAdapterReady( |
| + base::Bind(&SystemTrayDelegate::InitializeOnAdapterReady, |
| + ui_weak_ptr_factory_->GetWeakPtr())); |
| + } |
| + |
| + void InitializeOnAdapterReady( |
| + scoped_refptr<device::BluetoothAdapter> adapter) { |
| + bluetooth_adapter_ = adapter; |
| + CHECK(bluetooth_adapter_); |
|
Nikita (slow)
2013/01/10 10:29:55
You're passing adapter as a weak pointer so NULL c
youngki
2013/01/10 18:58:54
Yes, a weak pointer passed from BluetoothAdapterFa
Nikita (slow)
2013/01/11 11:15:09
So do you actually need a CHECK here or would it b
youngki
2013/01/11 13:18:47
I think we need a check here since bluetooth_adapt
Nikita (slow)
2013/01/11 15:34:21
I don't want to block this CL but it seems a bit s
youngki
2013/01/11 16:47:56
That's a valid concern; I appreciate you point it
|
| bluetooth_adapter_->AddObserver(this); |
| local_state_registrar_.Init(g_browser_process->local_state()); |