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

Unified Diff: chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc

Issue 2304213002: Show device connection and paired status in chooser on Mac (Closed)
Patch Set: added comments Created 4 years, 3 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/bluetooth/bluetooth_chooser_controller.cc
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
index 182a80ab312f15b967c4feb96caf97662bc396f5..fe260f303e284095a426acc9a226da4cc4a2355e 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -67,6 +67,14 @@ int BluetoothChooserController::GetSignalStrengthLevel(size_t index) const {
return devices_[index].signal_strength_level;
}
+bool BluetoothChooserController::IsConnected(size_t index) const {
+ return devices_[index].is_connected;
+}
+
+bool BluetoothChooserController::IsPaired(size_t index) const {
+ return devices_[index].is_paired;
+}
+
base::string16 BluetoothChooserController::GetOption(size_t index) const {
DCHECK_LT(index, devices_.size());
const std::string& device_id = devices_[index].id;
@@ -208,19 +216,20 @@ void BluetoothChooserController::AddOrUpdateDevice(
});
DCHECK(device_it != devices_.end());
- // http://crbug.com/543466 Update connection and paired status
-
// When Bluetooth device scanning stops, the |signal_strength_level|
// is -1, and in this case, should still use the previously stored
// signal strength level value.
if (signal_strength_level != -1)
device_it->signal_strength_level = signal_strength_level;
+ device_it->is_connected = is_gatt_connected;
+ device_it->is_paired = is_paired;
if (view())
view()->OnOptionUpdated(device_it - devices_.begin());
return;
}
- devices_.push_back({device_id, signal_strength_level});
+ devices_.push_back(
+ {device_id, signal_strength_level, is_gatt_connected, is_paired});
device_id_to_name_map_.insert({device_id, device_name});
++device_name_counts_[device_name];
if (view())
« no previous file with comments | « chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h ('k') | chrome/browser/ui/cocoa/chooser_content_view_cocoa.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698