| 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 "components/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 explicit BluetoothChooserController( |
| 26 content::RenderFrameHost* owner, | 26 content::RenderFrameHost* owner, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 46 // Each pair is a (device name, device id). | 46 // Each pair is a (device name, device id). |
| 47 std::vector<std::pair<base::string16, std::string>> device_names_and_ids_; | 47 std::vector<std::pair<base::string16, std::string>> device_names_and_ids_; |
| 48 content::BluetoothChooser::EventHandler event_handler_; | 48 content::BluetoothChooser::EventHandler event_handler_; |
| 49 // Maps from device name to number of devices. | 49 // Maps from device name to number of devices. |
| 50 std::unordered_map<base::string16, int> device_name_map_; | 50 std::unordered_map<base::string16, int> device_name_map_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserController); | 52 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserController); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ | 55 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_CONTROLLER_H_ |
| OLD | NEW |