зеркало из https://github.com/electron/electron.git
chore: eliminate a few uses of base::AdaptCallbackForRepeating() (#38293)
This commit is contained in:
Родитель
642950a00e
Коммит
2acb97aa85
|
@ -653,8 +653,7 @@ void Session::SetPermissionRequestHandler(v8::Local<v8::Value> val,
|
|||
blink::PermissionType permission_type,
|
||||
ElectronPermissionManager::StatusCallback callback,
|
||||
const base::Value& details) {
|
||||
handler->Run(web_contents, permission_type,
|
||||
base::AdaptCallbackForRepeating(std::move(callback)),
|
||||
handler->Run(web_contents, permission_type, std::move(callback),
|
||||
details);
|
||||
},
|
||||
base::Owned(std::move(handler))));
|
||||
|
|
|
@ -179,9 +179,9 @@ void ElectronBluetoothDelegate::ShowDevicePairPrompt(
|
|||
}
|
||||
|
||||
permission_manager->CheckBluetoothDevicePair(
|
||||
details, base::AdaptCallbackForRepeating(base::BindOnce(
|
||||
&ElectronBluetoothDelegate::OnDevicePairPromptResponse,
|
||||
weak_factory_.GetWeakPtr(), std::move(callback))));
|
||||
details,
|
||||
base::BindOnce(&ElectronBluetoothDelegate::OnDevicePairPromptResponse,
|
||||
weak_factory_.GetWeakPtr(), std::move(callback)));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -247,9 +247,8 @@ void HidChooserController::OnGotDevices(
|
|||
.Build();
|
||||
prevent_default =
|
||||
session->Emit("select-hid-device", details,
|
||||
base::AdaptCallbackForRepeating(
|
||||
base::BindOnce(&HidChooserController::OnDeviceChosen,
|
||||
weak_factory_.GetWeakPtr())));
|
||||
base::BindRepeating(&HidChooserController::OnDeviceChosen,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
}
|
||||
if (!prevent_default) {
|
||||
RunCallback({});
|
||||
|
|
|
@ -156,11 +156,10 @@ void SerialChooserController::OnGetDevices(
|
|||
bool prevent_default = false;
|
||||
api::Session* session = GetSession();
|
||||
if (session) {
|
||||
prevent_default =
|
||||
session->Emit("select-serial-port", ports_, web_contents(),
|
||||
base::AdaptCallbackForRepeating(base::BindOnce(
|
||||
&SerialChooserController::OnDeviceChosen,
|
||||
weak_factory_.GetWeakPtr())));
|
||||
prevent_default = session->Emit(
|
||||
"select-serial-port", ports_, web_contents(),
|
||||
base::BindRepeating(&SerialChooserController::OnDeviceChosen,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
}
|
||||
if (!prevent_default) {
|
||||
RunCallback(/*port=*/nullptr);
|
||||
|
|
|
@ -126,9 +126,8 @@ void UsbChooserController::GotUsbDeviceList(
|
|||
|
||||
prevent_default =
|
||||
session->Emit("select-usb-device", details,
|
||||
base::AdaptCallbackForRepeating(
|
||||
base::BindOnce(&UsbChooserController::OnDeviceChosen,
|
||||
weak_factory_.GetWeakPtr())));
|
||||
base::BindRepeating(&UsbChooserController::OnDeviceChosen,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
}
|
||||
if (!prevent_default) {
|
||||
RunCallback(/*device_info=*/nullptr);
|
||||
|
|
Загрузка…
Ссылка в новой задаче