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

Side by Side Diff: chrome/browser/ui/bluetooth/bluetooth_chooser_controller.h

Issue 2126873003: Change WebBluetooth chooser title to "pair with" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@support_chrome_extension_chooser_title
Patch Set: rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 10 matching lines...) Expand all
21 // It can be used by WebBluetooth API to get the user's permission to 21 // It can be used by WebBluetooth API to get the user's permission to
22 // access a Bluetooth device. It is owned by ChooserBubbleDelegate. 22 // access a Bluetooth device. It is owned by ChooserBubbleDelegate.
23 class BluetoothChooserController : public ChooserController { 23 class BluetoothChooserController : public ChooserController {
24 public: 24 public:
25 explicit BluetoothChooserController( 25 explicit BluetoothChooserController(
26 content::RenderFrameHost* owner, 26 content::RenderFrameHost* owner,
27 const content::BluetoothChooser::EventHandler& event_handler); 27 const content::BluetoothChooser::EventHandler& event_handler);
28 ~BluetoothChooserController() override; 28 ~BluetoothChooserController() override;
29 29
30 // ChooserController: 30 // ChooserController:
31 base::string16 GetTitle() const override;
31 base::string16 GetOkButtonLabel() const override; 32 base::string16 GetOkButtonLabel() const override;
32 size_t NumOptions() const override; 33 size_t NumOptions() const override;
33 base::string16 GetOption(size_t index) const override; 34 base::string16 GetOption(size_t index) const override;
34 void Select(size_t index) override; 35 void Select(size_t index) override;
35 void Cancel() override; 36 void Cancel() override;
36 void Close() override; 37 void Close() override;
37 void OpenHelpCenterUrl() const override; 38 void OpenHelpCenterUrl() const override;
38 39
39 // Shows a new device in the chooser. 40 // Shows a new device in the chooser.
40 void AddDevice(const std::string& device_id, 41 void AddDevice(const std::string& device_id,
41 const base::string16& device_name); 42 const base::string16& device_name);
42 43
43 // Tells the chooser that a device is no longer available. 44 // Tells the chooser that a device is no longer available.
44 void RemoveDevice(const std::string& device_id); 45 void RemoveDevice(const std::string& device_id);
45 46
46 private: 47 private:
47 // Each pair is a (device name, device id). 48 // Each pair is a (device name, device id).
48 std::vector<std::pair<base::string16, std::string>> device_names_and_ids_; 49 std::vector<std::pair<base::string16, std::string>> device_names_and_ids_;
49 content::BluetoothChooser::EventHandler event_handler_; 50 content::BluetoothChooser::EventHandler event_handler_;
50 // Maps from device name to number of devices. 51 // Maps from device name to number of devices.
51 std::unordered_map<base::string16, int> device_name_map_; 52 std::unordered_map<base::string16, int> device_name_map_;
52 53
53 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserController); 54 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserController);
54 }; 55 };
55 56
56 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ 57 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698