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

Unified Diff: chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc

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

Powered by Google App Engine
This is Rietveld 408576698