| 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" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 // defaults to DISCOVERING. | 67 // defaults to DISCOVERING. |
| 68 enum class DiscoveryState { FAILED_TO_START, DISCOVERING, IDLE }; | 68 enum class DiscoveryState { FAILED_TO_START, DISCOVERING, IDLE }; |
| 69 virtual void ShowDiscoveryState(DiscoveryState state) {} | 69 virtual void ShowDiscoveryState(DiscoveryState state) {} |
| 70 | 70 |
| 71 // Adds a new device to the chooser or updates the information of an existing | 71 // Adds a new device to the chooser or updates the information of an existing |
| 72 // device. | 72 // device. |
| 73 // | 73 // |
| 74 // Sometimes when a Bluetooth device stops advertising, the |device_name| can | 74 // Sometimes when a Bluetooth device stops advertising, the |device_name| can |
| 75 // be invalid, and in that case |should_update_name| will be set false. | 75 // be invalid, and in that case |should_update_name| will be set false. |
| 76 // | 76 // |
| 77 // Passing nullptr for |rssi| means that the device doesn't have RSSI which | 77 // The range of |signal_strength_level| is -1 to 4 inclusively. |
| 78 // happens when the device is already connected. | 78 // -1 means that the device doesn't have RSSI which happens when the device |
| 79 // is already connected. |
| 79 virtual void AddOrUpdateDevice(const std::string& device_id, | 80 virtual void AddOrUpdateDevice(const std::string& device_id, |
| 80 bool should_update_name, | 81 bool should_update_name, |
| 81 const base::string16& device_name, | 82 const base::string16& device_name, |
| 82 bool is_gatt_connected, | 83 bool is_gatt_connected, |
| 83 bool is_paired, | 84 bool is_paired, |
| 84 const int8_t* rssi) {} | 85 int signal_strength_level) {} |
| 85 | 86 |
| 86 // Tells the chooser that a device is no longer available. The chooser should | 87 // Tells the chooser that a device is no longer available. The chooser should |
| 87 // not call DeviceSelected() for a device that's been removed. | 88 // not call DeviceSelected() for a device that's been removed. |
| 88 virtual void RemoveDevice(const std::string& device_id) {} | 89 virtual void RemoveDevice(const std::string& device_id) {} |
| 89 }; | 90 }; |
| 90 | 91 |
| 91 } // namespace content | 92 } // namespace content |
| 92 | 93 |
| 93 #endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ | 94 #endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_CHOOSER_H_ |
| OLD | NEW |