Fixed BT bug
This commit is contained in:
parent
605f5472e5
commit
a6bab71215
1 changed files with 11 additions and 0 deletions
|
@ -97,6 +97,17 @@ void BluetoothChooser::AddOrUpdateDevice(const std::string& device_id,
|
||||||
int signal_strength_level) {
|
int signal_strength_level) {
|
||||||
DeviceInfo info = {device_id, device_name};
|
DeviceInfo info = {device_id, device_name};
|
||||||
device_list_.push_back(info);
|
device_list_.push_back(info);
|
||||||
|
|
||||||
|
// Emit a select-bluetooth-device handler to allow for user to listen for
|
||||||
|
// bluetooth device found.
|
||||||
|
bool prevent_default = api_web_contents_->Emit("select-bluetooth-device",
|
||||||
|
device_list_, base::Bind(&OnDeviceChosen, event_handler_));
|
||||||
|
|
||||||
|
// If emit not implimented select first device that matches the filters
|
||||||
|
// provided.
|
||||||
|
if (!prevent_default) {
|
||||||
|
event_handler_.Run(Event::SELECTED, device_id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BluetoothChooser::RemoveDevice(const std::string& device_id) {
|
void BluetoothChooser::RemoveDevice(const std::string& device_id) {
|
||||||
|
|
Loading…
Reference in a new issue