Chromium Code Reviews| 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 #include "content/public/browser/web_contents.h" | |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 // Represents a way to ask the user to select a Bluetooth device from a list of | 17 // Represents a way to ask the user to select a Bluetooth device from a list of |
| 17 // options. | 18 // options. |
| 18 class CONTENT_EXPORT BluetoothChooser { | 19 class CONTENT_EXPORT BluetoothChooser { |
| 19 public: | 20 public: |
| 20 enum class Event { | 21 enum class Event { |
| 21 // The user cancelled the chooser instead of selecting a device. | 22 // The user cancelled the chooser instead of selecting a device. |
| 22 CANCELLED, | 23 CANCELLED, |
| 23 // The user selected device |opt_device_id|. | 24 // The user selected device |opt_device_id|. |
| 24 SELECTED, | 25 SELECTED, |
| 26 // The user asked for a new Bluetooth discovery session to start. | |
| 27 RESCAN, | |
| 25 | 28 |
| 26 // As the dialog implementations grow more user-visible buttons and knobs, | 29 // As the dialog implementations grow more user-visible buttons and knobs, |
| 27 // we'll add enumerators here to support them. | 30 // we'll add enumerators here to support them. |
| 28 }; | 31 }; |
| 29 | 32 |
| 30 // Chooser implementations are constructed with an |EventHandler| and report | 33 // Chooser implementations are constructed with an |EventHandler| and report |
| 31 // user interaction with the chooser through it. |opt_device_id| is an empty | 34 // user interaction with the chooser through it. |opt_device_id| is an empty |
| 32 // string except for Event::SELECTED. | 35 // string except for Event::SELECTED. |
| 33 // | 36 // |
| 34 // The EventHandler won't be called after the chooser object is destroyed. | 37 // The EventHandler won't be called after the chooser object is destroyed. |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 52 enum class DiscoveryState { FAILED_TO_START, DISCOVERING, IDLE }; | 55 enum class DiscoveryState { FAILED_TO_START, DISCOVERING, IDLE }; |
| 53 virtual void ShowDiscoveryState(DiscoveryState state) {} | 56 virtual void ShowDiscoveryState(DiscoveryState state) {} |
| 54 | 57 |
| 55 // Shows a new device in the chooser. | 58 // Shows a new device in the chooser. |
| 56 virtual void AddDevice(const std::string& device_id, | 59 virtual void AddDevice(const std::string& device_id, |
| 57 const base::string16& device_name) {} | 60 const base::string16& device_name) {} |
| 58 | 61 |
| 59 // Tells the chooser that a device is no longer available. The chooser should | 62 // Tells the chooser that a device is no longer available. The chooser should |
| 60 // not call DeviceSelected() for a device that's been removed. | 63 // not call DeviceSelected() for a device that's been removed. |
| 61 virtual void RemoveDevice(const std::string& device_id) {} | 64 virtual void RemoveDevice(const std::string& device_id) {} |
| 65 | |
| 66 // Show various help links for the dialog. | |
| 67 void ShowOverviewLink(content::WebContents* web_contents); | |
|
Jeffrey Yasskin
2015/09/01 17:09:49
Can you add these in a separate CL so we don't nee
Finnur
2015/09/02 16:01:43
Shifted this over to BluetoothDispatcherHost. :)
| |
| 68 void ShowPairingLink(content::WebContents* web_contents); | |
| 69 void ShowAdapterOffLink(content::WebContents* web_contents); | |
| 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 |