| 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, |
| 25 | 27 |
| 26 // As the dialog implementations grow more user-visible buttons and knobs, | 28 // As the dialog implementations grow more user-visible buttons and knobs, |
| 27 // we'll add enumerators here to support them. | 29 // we'll add enumerators here to support them. |
| 28 }; | 30 }; |
| 29 | 31 |
| 30 // Chooser implementations are constructed with an |EventHandler| and report | 32 // Chooser implementations are constructed with an |EventHandler| and report |
| 31 // user interaction with the chooser through it. |opt_device_id| is an empty | 33 // user interaction with the chooser through it. |opt_device_id| is an empty |
| 32 // string except for Event::SELECTED. | 34 // string except for Event::SELECTED. |
| 33 // | 35 // |
| 34 // The EventHandler won't be called after the chooser object is destroyed. | 36 // 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) {} | 59 const base::string16& device_name) {} |
| 58 | 60 |
| 59 // Tells the chooser that a device is no longer available. The chooser should | 61 // Tells the chooser that a device is no longer available. The chooser should |
| 60 // not call DeviceSelected() for a device that's been removed. | 62 // not call DeviceSelected() for a device that's been removed. |
| 61 virtual void RemoveDevice(const std::string& device_id) {} | 63 virtual void RemoveDevice(const std::string& device_id) {} |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace content | 66 } // namespace content |
| 65 | 67 |
| 66 #endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 68 #endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |
| OLD | NEW |