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

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

Issue 2210873003: bluetooth: Allow updates on chooser items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bluetooth-fix-advertised-services
Patch Set: Make const Created 4 years, 4 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.h
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h
index d113f7eba0026ffc1951c108f7bdf2d07c410095..2c6b9db37e68c64e8f100786d3aa309c793b46bc 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h
@@ -47,9 +47,15 @@ class BluetoothChooserController : public ChooserController {
// discovery is happening.
void OnDiscoveryStateChanged(content::BluetoothChooser::DiscoveryState state);
- // Shows a new device in the chooser.
- void AddDevice(const std::string& device_id,
- const base::string16& device_name);
+ // Shows a new device in the chooser or updates its information.
+ // TODO(ortuno): Update device's name if necessary.
+ // https://crbug.com/634366
+ void AddOrUpdateDevice(const std::string& device_id,
+ bool should_update_name,
+ const base::string16& device_name,
+ bool is_gatt_connected,
+ bool is_paired,
+ const int8_t* rssi);
// Tells the chooser that a device is no longer available.
void RemoveDevice(const std::string& device_id);
@@ -63,11 +69,12 @@ class BluetoothChooserController : public ChooserController {
// Bluetooth adapter is turned on or off, or when re-scan happens.
void ClearAllDevices();
- // Each pair is a (device name, device id).
- std::vector<std::pair<base::string16, std::string>> device_names_and_ids_;
- content::BluetoothChooser::EventHandler event_handler_;
+ std::vector<std::string> device_ids_;
+ std::unordered_map<std::string, base::string16> device_id_to_name_map_;
// Maps from device name to number of devices.
std::unordered_map<base::string16, int> device_name_map_;
+
+ content::BluetoothChooser::EventHandler event_handler_;
base::string16 no_devices_text_;
base::string16 status_text_;
« no previous file with comments | « chrome/browser/ui/android/bluetooth_chooser_android.cc ('k') | chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698