Changed DefaultAdapter to RunCallbackOnAdapterReady function.

Instead of returning BluetoothAdapter instance directly, RunCallbackOnAdapterReady will run the callback with the instance of BluetoothAdapter. The idea is that we want to make sure that the BluetoothAdapter is used when it is fully initialized.

Right now the function is still synchronous; the callback will be run immediately after BluetoothAdapter is created within BluetoothAdapterFactory::RunCallbackOnAdapterReady(), so nothing should be broken in BluetoothOptionsHandler and AshSystemTrayDelegate. But later I will eventually change BluetoothAdapterFactory::RunCallbackOnAdapterReady() asynchronous, so we should discuss how we change BluetoothOptionsHandler and AshTryDelegate. Jenny, could you make changes on BluetoothOptionsHandler and AshSystemTrayDelegate to accomodate asynchronous RunCallbackOnAdapterReady() calls? We can also discuss how to make those changes together.

Also is BluetoothAdapterFactory::Create() ever used? Maybe this function will be needed in the future, but currently I don't see this function being called; can we just remove this if it is not used currently and add it back when we actually use it?

I will update unittests soon, but I wanted to send this out so that I can get initial preliminary review first.


BUG=135470

Review URL: https://chromiumcodereview.appspot.com/11819007

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176523 0039d316-1c4b-4281-b951-d872f2087c98
12 files changed