fix: select-bluetooth-device on Windows (#29591)
This commit is contained in:
parent
c9ccd136a8
commit
396ea4b29c
2 changed files with 3 additions and 1 deletions
|
@ -60,6 +60,7 @@ void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
|
||||||
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
|
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
|
||||||
break;
|
break;
|
||||||
case AdapterPresence::POWERED_ON:
|
case AdapterPresence::POWERED_ON:
|
||||||
|
rescan_ = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -92,7 +93,7 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
|
||||||
case DiscoveryState::DISCOVERING:
|
case DiscoveryState::DISCOVERING:
|
||||||
// The first time this state fires is due to a rescan triggering so set a
|
// The first time this state fires is due to a rescan triggering so set a
|
||||||
// flag to ignore devices
|
// flag to ignore devices
|
||||||
if (!refreshing_) {
|
if (rescan_ && !refreshing_) {
|
||||||
refreshing_ = true;
|
refreshing_ = true;
|
||||||
} else {
|
} else {
|
||||||
// The second time this state fires we are now safe to pick a device
|
// The second time this state fires we are now safe to pick a device
|
||||||
|
|
|
@ -42,6 +42,7 @@ class BluetoothChooser : public content::BluetoothChooser {
|
||||||
EventHandler event_handler_;
|
EventHandler event_handler_;
|
||||||
int num_retries_ = 0;
|
int num_retries_ = 0;
|
||||||
bool refreshing_ = false;
|
bool refreshing_ = false;
|
||||||
|
bool rescan_ = false;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
|
DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue