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

Unified Diff: device/bluetooth/bluetooth_device_chromeos.cc

Issue 12374062: Bluetooth: Send UI notifications when the connecting status changes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: NotifyDeviceChanged Created 7 years, 8 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
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/bluetooth_device_chromeos.cc
diff --git a/device/bluetooth/bluetooth_device_chromeos.cc b/device/bluetooth/bluetooth_device_chromeos.cc
index b456cf4a011dde707ef312023d4342de4680121c..9aaca420e27059fc90910e1c2a7c4f8078edee2d 100644
--- a/device/bluetooth/bluetooth_device_chromeos.cc
+++ b/device/bluetooth/bluetooth_device_chromeos.cc
@@ -148,6 +148,10 @@ void BluetoothDeviceChromeOS::Connect(
// This is safe because Connect() and its callbacks are called in the same
// thread.
connecting_calls_++;
+ if (!connecting_) {
+ connecting_ = true;
+ adapter_->NotifyDeviceChanged(this);
+ }
connecting_ = !!connecting_calls_;
// Set the decrement to be issued when either callback is called.
base::Closure wrapped_callback = base::Bind(
@@ -524,18 +528,22 @@ void BluetoothDeviceChromeOS::OnGetServiceRecordsError(
void BluetoothDeviceChromeOS::OnConnectCallbackCalled(
const base::Closure& callback) {
// Update the connecting status.
+ bool prev_connecting = !!connecting_calls_;
keybuk 2013/04/18 15:54:17 why is this not just: bool prev_connecting = co
deymo 2013/04/18 16:27:43 It could be any of those... why one or the other??
keybuk 2013/04/18 17:12:05 You're making an assumption that connecting_ is ca
deymo 2013/04/19 01:40:30 Done.
connecting_calls_--;
connecting_ = !!connecting_calls_;
callback.Run();
+ if (prev_connecting != connecting_) adapter_->NotifyDeviceChanged(this);
}
void BluetoothDeviceChromeOS::OnConnectErrorCallbackCalled(
const ConnectErrorCallback& error_callback,
enum ConnectErrorCode error_code) {
// Update the connecting status.
+ bool prev_connecting = !!connecting_calls_;
keybuk 2013/04/18 15:54:17 ditto
deymo 2013/04/19 01:40:30 Done.
connecting_calls_--;
connecting_ = !!connecting_calls_;
error_callback.Run(error_code);
+ if (prev_connecting != connecting_) adapter_->NotifyDeviceChanged(this);
}
void BluetoothDeviceChromeOS::ConnectApplications(
« no previous file with comments | « device/bluetooth/bluetooth_adapter_chromeos.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698