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_DESKTOP_H_ | 5 #ifndef CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_DESKTOP_H_ |
6 #define CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_DESKTOP_H_ | 6 #define CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_DESKTOP_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/public/browser/bluetooth_chooser.h" | 9 #include "content/public/browser/bluetooth_chooser.h" |
10 | 10 |
11 class BluetoothChooserBubbleDelegate; | 11 class BluetoothChooserBubbleController; |
12 | 12 |
13 // Represents a Bluetooth chooser to ask the user to select a Bluetooth | 13 // Represents a Bluetooth chooser to ask the user to select a Bluetooth |
14 // device from a list of options. This implementation is for desktop. | 14 // device from a list of options. This implementation is for desktop. |
15 // BluetoothChooserAndroid implements the mobile part. | 15 // BluetoothChooserAndroid implements the mobile part. |
16 class BluetoothChooserDesktop : public content::BluetoothChooser { | 16 class BluetoothChooserDesktop : public content::BluetoothChooser { |
17 public: | 17 public: |
18 explicit BluetoothChooserDesktop( | 18 explicit BluetoothChooserDesktop( |
19 const content::BluetoothChooser::EventHandler& event_handler); | 19 const content::BluetoothChooser::EventHandler& event_handler); |
20 ~BluetoothChooserDesktop() override; | 20 ~BluetoothChooserDesktop() override; |
21 | 21 |
22 // BluetoothChooser: | 22 // BluetoothChooser: |
23 void SetAdapterPresence(AdapterPresence presence) override; | 23 void SetAdapterPresence(AdapterPresence presence) override; |
24 void ShowDiscoveryState(DiscoveryState state) override; | 24 void ShowDiscoveryState(DiscoveryState state) override; |
25 void AddDevice(const std::string& device_id, | 25 void AddDevice(const std::string& device_id, |
26 const base::string16& device_name) override; | 26 const base::string16& device_name) override; |
27 void RemoveDevice(const std::string& device_id) override; | 27 void RemoveDevice(const std::string& device_id) override; |
28 | 28 |
29 void set_bluetooth_chooser_bubble_delegate( | 29 void set_bluetooth_chooser_bubble_controller( |
30 BluetoothChooserBubbleDelegate* bluetooth_chooser_bubble_delegate) { | 30 BluetoothChooserBubbleController* bluetooth_chooser_bubble_controller) { |
31 bluetooth_chooser_bubble_delegate_ = bluetooth_chooser_bubble_delegate; | 31 bluetooth_chooser_bubble_controller_ = bluetooth_chooser_bubble_controller; |
32 } | 32 } |
33 | 33 |
34 // Use this function to call event_handler_. | 34 // Use this function to call event_handler_. |
35 void CallEventHandler(content::BluetoothChooser::Event event, | 35 void CallEventHandler(content::BluetoothChooser::Event event, |
36 const std::string& device_id); | 36 const std::string& device_id); |
37 | 37 |
38 private: | 38 private: |
39 content::BluetoothChooser::EventHandler event_handler_; | 39 content::BluetoothChooser::EventHandler event_handler_; |
40 BluetoothChooserBubbleDelegate* bluetooth_chooser_bubble_delegate_; | 40 BluetoothChooserBubbleController* bluetooth_chooser_bubble_controller_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserDesktop); | 42 DISALLOW_COPY_AND_ASSIGN(BluetoothChooserDesktop); |
43 }; | 43 }; |
44 | 44 |
45 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_DESKTOP_H_ | 45 #endif // CHROME_BROWSER_UI_BLUETOOTH_BLUETOOTH_CHOOSER_DESKTOP_H_ |
OLD | NEW |