chore: remove last instances of base::Bind (#18178)

* chore: remove last instances of base::Bind

* MessageBoxCallback is a OnceCallback

* convert permission helepr cbs to Once

* convert ResponseCallback to Once
This commit is contained in:
Shelley Vohr 2019-05-29 13:02:15 -07:00 committed by GitHub
parent 96371b6d75
commit 9af5072115
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 122 additions and 109 deletions

View file

@ -561,7 +561,7 @@ void AtomBrowserClient::AllowCertificateError(
bool is_main_frame_request,
bool strict_enforcement,
bool expired_previous_decision,
const base::Callback<void(content::CertificateRequestResultType)>&
const base::RepeatingCallback<void(content::CertificateRequestResultType)>&
callback) {
if (delegate_) {
delegate_->AllowCertificateError(
@ -743,21 +743,21 @@ content::BrowserMainParts* AtomBrowserClient::CreateBrowserMainParts(
void AtomBrowserClient::WebNotificationAllowed(
int render_process_id,
const base::RepeatingCallback<void(bool, bool)>& callback) {
base::OnceCallback<void(bool, bool)> callback) {
content::WebContents* web_contents =
WebContentsPreferences::GetWebContentsFromProcessID(render_process_id);
if (!web_contents) {
callback.Run(false, false);
std::move(callback).Run(false, false);
return;
}
auto* permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents);
if (!permission_helper) {
callback.Run(false, false);
std::move(callback).Run(false, false);
return;
}
permission_helper->RequestWebNotificationPermission(
base::Bind(callback, web_contents->IsAudioMuted()));
base::BindOnce(std::move(callback), web_contents->IsAudioMuted()));
}
void AtomBrowserClient::RenderProcessHostDestroyed(
@ -809,9 +809,9 @@ void HandleExternalProtocolInUI(
return;
GURL escaped_url(net::EscapeExternalHandlerValue(url.spec()));
auto callback = base::Bind(&OnOpenExternal, escaped_url);
permission_helper->RequestOpenExternalPermission(callback, has_user_gesture,
url);
auto callback = base::BindOnce(&OnOpenExternal, escaped_url);
permission_helper->RequestOpenExternalPermission(std::move(callback),
has_user_gesture, url);
}
bool AtomBrowserClient::HandleExternalProtocol(