OLD | NEW |
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> |
11 #include <unordered_map> | 11 #include <unordered_map> |
12 #include <utility> | 12 #include <utility> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "chrome/browser/chooser_controller/chooser_controller.h" | 16 #include "chrome/browser/chooser_controller/chooser_controller.h" |
17 #include "content/public/browser/bluetooth_chooser.h" | 17 #include "content/public/browser/bluetooth_chooser.h" |
18 | 18 |
19 // BluetoothChooserController is a chooser that presents a list of | 19 // BluetoothChooserController is a chooser that presents a list of |
20 // Bluetooth device names, which come from |bluetooth_chooser_desktop_|. | 20 // Bluetooth device names, which come from |bluetooth_chooser_desktop_|. |
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 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 bool ShouldShowIconBeforeText() const override; | 31 bool ShouldShowIconBeforeText() const override; |
32 base::string16 GetNoOptionsText() const override; | 32 base::string16 GetNoOptionsText() const override; |
33 base::string16 GetOkButtonLabel() const override; | 33 base::string16 GetOkButtonLabel() const override; |
34 size_t NumOptions() const override; | 34 size_t NumOptions() const override; |
35 int GetSignalStrengthLevel(size_t index) const override; | 35 int GetSignalStrengthLevel(size_t index) const override; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // Maps from device name to number of devices with that name. | 85 // Maps from device name to number of devices with that name. |
86 std::unordered_map<base::string16, int> device_name_counts_; | 86 std::unordered_map<base::string16, int> device_name_counts_; |
87 | 87 |
88 content::BluetoothChooser::EventHandler event_handler_; | 88 content::BluetoothChooser::EventHandler event_handler_; |
89 base::string16 status_text_; | 89 base::string16 status_text_; |
90 | 90 |
91 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserController); | 91 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserController); |
92 }; | 92 }; |
93 | 93 |
94 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ | 94 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ |
OLD | NEW |