chore: use std::make_unique/base::MakeRefCounted when possible (#29510)

This commit is contained in:
David Sanders 2021-06-07 19:00:05 -07:00 committed by GitHub
parent a4decffe9a
commit 79cb5144ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 106 additions and 101 deletions

View file

@ -111,9 +111,8 @@ ElectronManagementAPIDelegate::SetEnabledFunctionDelegate(
content::BrowserContext* browser_context,
const extensions::Extension* extension,
base::OnceCallback<void(bool)> callback) const {
return std::unique_ptr<ManagementSetEnabledFunctionInstallPromptDelegate>(
new ManagementSetEnabledFunctionInstallPromptDelegate(
web_contents, browser_context, extension, std::move(callback)));
return std::make_unique<ManagementSetEnabledFunctionInstallPromptDelegate>(
web_contents, browser_context, extension, std::move(callback));
}
std::unique_ptr<extensions::UninstallDialogDelegate>
@ -121,9 +120,8 @@ ElectronManagementAPIDelegate::UninstallFunctionDelegate(
extensions::ManagementUninstallFunctionBase* function,
const extensions::Extension* target_extension,
bool show_programmatic_uninstall_ui) const {
return std::unique_ptr<extensions::UninstallDialogDelegate>(
new ManagementUninstallFunctionUninstallDialogDelegate(
function, target_extension, show_programmatic_uninstall_ui));
return std::make_unique<ManagementUninstallFunctionUninstallDialogDelegate>(
function, target_extension, show_programmatic_uninstall_ui);
}
bool ElectronManagementAPIDelegate::CreateAppShortcutFunctionDelegate(