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 CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |
6 #define CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 6 #define CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
14 namespace content { | 14 namespace content { |
15 | 15 |
16 // Represents a way to ask the user to select a Bluetooth device from a list of | 16 // Represents a way to ask the user to select a Bluetooth device from a list of |
17 // options. | 17 // options. |
18 class CONTENT_EXPORT BluetoothChooser { | 18 class CONTENT_EXPORT BluetoothChooser { |
19 public: | 19 public: |
20 enum class Event { | 20 enum class Event { |
21 // The user cancelled the chooser instead of selecting a device. | 21 // The user cancelled the chooser instead of selecting a device. |
22 CANCELLED, | 22 CANCELLED, |
23 // The user selected device |opt_device_id|. | 23 // The user selected device |opt_device_id|. |
24 SELECTED, | 24 SELECTED, |
| 25 // The user asked for a new Bluetooth discovery session to start. |
| 26 RESCAN, |
| 27 // Show overview page for Bluetooth. |
| 28 SHOW_OVERVIEW_HELP, |
| 29 // Show help page explaining what Bluetooth pairing means. |
| 30 SHOW_PAIRING_HELP, |
| 31 // Show help page explaining why scanning failed because Bluetooth is off. |
| 32 SHOW_ADAPTER_OFF_HELP, |
25 | 33 |
26 // As the dialog implementations grow more user-visible buttons and knobs, | 34 // As the dialog implementations grow more user-visible buttons and knobs, |
27 // we'll add enumerators here to support them. | 35 // we'll add enumerators here to support them. |
28 }; | 36 }; |
29 | 37 |
30 // Chooser implementations are constructed with an |EventHandler| and report | 38 // Chooser implementations are constructed with an |EventHandler| and report |
31 // user interaction with the chooser through it. |opt_device_id| is an empty | 39 // user interaction with the chooser through it. |opt_device_id| is an empty |
32 // string except for Event::SELECTED. | 40 // string except for Event::SELECTED. |
33 // | 41 // |
34 // The EventHandler won't be called after the chooser object is destroyed. | 42 // The EventHandler won't be called after the chooser object is destroyed. |
(...skipping 22 matching lines...) Expand all Loading... |
57 const base::string16& device_name) {} | 65 const base::string16& device_name) {} |
58 | 66 |
59 // Tells the chooser that a device is no longer available. The chooser should | 67 // Tells the chooser that a device is no longer available. The chooser should |
60 // not call DeviceSelected() for a device that's been removed. | 68 // not call DeviceSelected() for a device that's been removed. |
61 virtual void RemoveDevice(const std::string& device_id) {} | 69 virtual void RemoveDevice(const std::string& device_id) {} |
62 }; | 70 }; |
63 | 71 |
64 } // namespace content | 72 } // namespace content |
65 | 73 |
66 #endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 74 #endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |
OLD | NEW |