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

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: updated comments 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
« no previous file with comments | « no previous file | chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.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_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..a1555d72d5225d87e73e65eb25e33550cfd86742 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_;
+ // Each pair is a (device name, device id).
+ std::vector<std::pair<base::string16, std::string>> device_names_and_ids_;
BluetoothChooserDesktop* bluetooth_chooser_;
BubbleReference bubble_controller_;
« no previous file with comments | « no previous file | chrome/browser/ui/bluetooth/bluetooth_chooser_bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698