OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_CHROME_EXTENSION_BLUETOOTH_CHOOSER_H_ | 5 #ifndef CHROME_BROWSER_UI_BLUETOOTH_CHROME_EXTENSION_BLUETOOTH_CHOOSER_H_ |
6 #define CHROME_BROWSER_UI_BLUETOOTH_CHROME_EXTENSION_BLUETOOTH_CHOOSER_H_ | 6 #define CHROME_BROWSER_UI_BLUETOOTH_CHROME_EXTENSION_BLUETOOTH_CHOOSER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "content/public/browser/bluetooth_chooser.h" | 11 #include "content/public/browser/bluetooth_chooser.h" |
12 | 12 |
13 class BluetoothChooserController; | 13 class BluetoothChooserController; |
14 class ChromeExtensionChooserDialog; | 14 class ChromeExtensionChooserDialog; |
15 | 15 |
16 namespace content { | 16 namespace content { |
17 class RenderFrameHost; | 17 class RenderFrameHost; |
18 } | 18 } |
19 | 19 |
20 // Represents a Bluetooth chooser to ask the user to select a Bluetooth | 20 // Represents a Bluetooth chooser to ask the user to select a Bluetooth |
21 // device from a list of options. This implementation is for extensions. | 21 // device from a list of options. This implementation is for extensions. |
22 class ChromeExtensionBluetoothChooser : public content::BluetoothChooser { | 22 class ChromeExtensionBluetoothChooser : public content::BluetoothChooser { |
23 public: | 23 public: |
24 ChromeExtensionBluetoothChooser( | 24 ChromeExtensionBluetoothChooser( |
25 content::RenderFrameHost* frame, | 25 content::RenderFrameHost* frame, |
26 const content::BluetoothChooser::EventHandler& event_handler); | 26 const content::BluetoothChooser::EventHandler& event_handler, |
| 27 bool accept_all_devices); |
27 ~ChromeExtensionBluetoothChooser() override; | 28 ~ChromeExtensionBluetoothChooser() override; |
28 | 29 |
29 // content::BluetoothChooser: | 30 // content::BluetoothChooser: |
30 void SetAdapterPresence(AdapterPresence presence) override; | 31 void SetAdapterPresence(AdapterPresence presence) override; |
31 void ShowDiscoveryState(DiscoveryState state) override; | 32 void ShowDiscoveryState(DiscoveryState state) override; |
32 void AddOrUpdateDevice(const std::string& device_id, | 33 void AddOrUpdateDevice(const std::string& device_id, |
33 bool should_update_name, | 34 bool should_update_name, |
34 const base::string16& device_name, | 35 const base::string16& device_name, |
35 bool is_gatt_connected, | 36 bool is_gatt_connected, |
36 bool is_paired, | 37 bool is_paired, |
37 int signal_strength_level) override; | 38 int signal_strength_level) override; |
38 void RemoveDevice(const std::string& device_id) override; | 39 void RemoveDevice(const std::string& device_id) override; |
39 | 40 |
40 private: | 41 private: |
41 // Weak. ChooserContentView[Cocoa] owns it. | 42 // Weak. ChooserContentView[Cocoa] owns it. |
42 BluetoothChooserController* bluetooth_chooser_controller_; | 43 BluetoothChooserController* bluetooth_chooser_controller_; |
43 std::unique_ptr<ChromeExtensionChooserDialog> chooser_dialog_; | 44 std::unique_ptr<ChromeExtensionChooserDialog> chooser_dialog_; |
44 | 45 |
45 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionBluetoothChooser); | 46 DISALLOW_COPY_AND_ASSIGN(ChromeExtensionBluetoothChooser); |
46 }; | 47 }; |
47 | 48 |
48 #endif // CHROME_BROWSER_UI_BLUETOOTH_CHROME_EXTENSION_BLUETOOTH_CHOOSER_H_ | 49 #endif // CHROME_BROWSER_UI_BLUETOOTH_CHROME_EXTENSION_BLUETOOTH_CHOOSER_H_ |
OLD | NEW |