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

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

Issue 2275173002: Add unit test for BluetoothChooserController (Closed)
Patch Set: address 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
« no previous file with comments | « no previous file | chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b47c524a6e8be034eb45285858b3c085bbeb63e1..182a80ab312f15b967c4feb96caf97662bc396f5 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_controller.cc
@@ -239,6 +239,7 @@ void BluetoothChooserController::RemoveDevice(const std::string& device_id) {
});
if (device_it != devices_.end()) {
+ size_t index = device_it - devices_.begin();
devices_.erase(device_it);
const auto& it = device_name_counts_.find(name_it->second);
@@ -251,7 +252,7 @@ void BluetoothChooserController::RemoveDevice(const std::string& device_id) {
device_id_to_name_map_.erase(name_it);
if (view())
- view()->OnOptionRemoved(device_it - devices_.begin());
+ view()->OnOptionRemoved(index);
}
}
« no previous file with comments | « no previous file | chrome/browser/ui/bluetooth/bluetooth_chooser_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698