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

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

Issue 11819007: Changed DefaultAdapter to RunCallbackOnAdapterReady function. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed device_unittests. Created 7 years, 11 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 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());

Powered by Google App Engine
This is Rietveld 408576698