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

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

Issue 1545773002: Address some TODOs for ChooserBubbleDelegate class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compile error on Mac again Created 4 years, 12 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_bubble_delegate.h
diff --git a/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h b/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h
index e4d2d4a755fc144464a9889fc594cbe03cadbd9a..967a29a6f2b4a5ad1c5fc7b3744f25e5fbfc4af3 100644
--- a/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h
+++ b/chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.h
@@ -24,8 +24,9 @@ class BluetoothChooserBubbleDelegate : public ChooserBubbleDelegate {
~BluetoothChooserBubbleDelegate() override;
// ChooserBubbleDelegate:
- const std::vector<base::string16>& GetOptions() const override;
- void Select(int index) override;
+ size_t NumOptions() const override;
+ const base::string16& GetOption(size_t index) const override;
+ void Select(size_t index) override;
void Cancel() override;
void Close() override;
@@ -45,17 +46,8 @@ class BluetoothChooserBubbleDelegate : public ChooserBubbleDelegate {
}
private:
- // TODO(juncai): use std::vector<std::pair<base::string16, std::string>>
- // here since the lengths can't get out of sync and each pair of items
- // is tightly associated.
- // Also need to change ChooserBubbleDelegate::GetOptions to be:
- // size_t NumOptions()
- // const base::string16& GetOption(size_t index)
- //
- // |device_names_| and |device_ids_| have the same length.
- // device_names_[i] is the name for the device with id device_ids_[i].
- std::vector<base::string16> device_names_;
- std::vector<std::string> device_ids_;
+ // The vector contains device name and device id pair for the same device.
Peter Kasting 2016/01/04 23:54:00 Nit: To follow the other comment, how about: Each
juncai 2016/01/05 03:37:27 Done.
+ std::vector<std::pair<base::string16, std::string>> device_names_and_ids_;
BluetoothChooserDesktop* bluetooth_chooser_;
BubbleReference bubble_controller_;

Powered by Google App Engine
This is Rietveld 408576698