Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: chrome/browser/extensions/api/management/chrome_management_api_delegate.cc

Issue 1871713002: Convert //chrome/browser/extensions from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and fix header Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
diff --git a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
index caeedfeb39009c0199c57841b1bc1029912a62ef..8ad8f83ef38afef578ab140b3cc67b0f1f6e1bac 100644
--- a/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
+++ b/chrome/browser/extensions/api/management/chrome_management_api_delegate.cc
@@ -6,6 +6,7 @@
#include "base/callback_helpers.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/bookmark_app_helper.h"
#include "chrome/browser/extensions/chrome_extension_function_details.h"
@@ -60,7 +61,7 @@ class ManagementSetEnabledFunctionInstallPromptDelegate
OnInstallPromptDone,
weak_factory_.GetWeakPtr()),
extension, nullptr,
- make_scoped_ptr(new ExtensionInstallPrompt::Prompt(type)),
+ base::WrapUnique(new ExtensionInstallPrompt::Prompt(type)),
ExtensionInstallPrompt::GetDefaultShowDialogCallback());
}
~ManagementSetEnabledFunctionInstallPromptDelegate() override {}
@@ -72,7 +73,7 @@ class ManagementSetEnabledFunctionInstallPromptDelegate
}
// Used for prompting to re-enable items with permissions escalation updates.
- scoped_ptr<ExtensionInstallPrompt> install_prompt_;
+ std::unique_ptr<ExtensionInstallPrompt> install_prompt_;
base::Callback<void(bool)> callback_;
@@ -119,7 +120,8 @@ class ManagementUninstallFunctionUninstallDialogDelegate
private:
extensions::ManagementUninstallFunctionBase* function_;
- scoped_ptr<extensions::ExtensionUninstallDialog> extension_uninstall_dialog_;
+ std::unique_ptr<extensions::ExtensionUninstallDialog>
+ extension_uninstall_dialog_;
DISALLOW_COPY_AND_ASSIGN(ManagementUninstallFunctionUninstallDialogDelegate);
};
@@ -155,7 +157,7 @@ class ChromeAppForLinkDelegate : public extensions::AppForLinkDelegate {
function));
}
- scoped_ptr<extensions::BookmarkAppHelper> bookmark_app_helper_;
+ std::unique_ptr<extensions::BookmarkAppHelper> bookmark_app_helper_;
// Used for favicon loading tasks.
base::CancelableTaskTracker cancelable_task_tracker_;
@@ -213,28 +215,28 @@ void ChromeManagementAPIDelegate::
function));
}
-scoped_ptr<extensions::InstallPromptDelegate>
+std::unique_ptr<extensions::InstallPromptDelegate>
ChromeManagementAPIDelegate::SetEnabledFunctionDelegate(
content::WebContents* web_contents,
content::BrowserContext* browser_context,
const extensions::Extension* extension,
const base::Callback<void(bool)>& callback) const {
- return scoped_ptr<ManagementSetEnabledFunctionInstallPromptDelegate>(
+ return std::unique_ptr<ManagementSetEnabledFunctionInstallPromptDelegate>(
new ManagementSetEnabledFunctionInstallPromptDelegate(
web_contents, browser_context, extension, callback));
}
-scoped_ptr<extensions::RequirementsChecker>
+std::unique_ptr<extensions::RequirementsChecker>
ChromeManagementAPIDelegate::CreateRequirementsChecker() const {
- return make_scoped_ptr(new extensions::ChromeRequirementsChecker());
+ return base::WrapUnique(new extensions::ChromeRequirementsChecker());
}
-scoped_ptr<extensions::UninstallDialogDelegate>
+std::unique_ptr<extensions::UninstallDialogDelegate>
ChromeManagementAPIDelegate::UninstallFunctionDelegate(
extensions::ManagementUninstallFunctionBase* function,
const extensions::Extension* target_extension,
bool show_programmatic_uninstall_ui) const {
- return scoped_ptr<extensions::UninstallDialogDelegate>(
+ return std::unique_ptr<extensions::UninstallDialogDelegate>(
new ManagementUninstallFunctionUninstallDialogDelegate(
function, target_extension, show_programmatic_uninstall_ui));
}
@@ -260,7 +262,7 @@ bool ChromeManagementAPIDelegate::CreateAppShortcutFunctionDelegate(
return true;
}
-scoped_ptr<extensions::AppForLinkDelegate>
+std::unique_ptr<extensions::AppForLinkDelegate>
ChromeManagementAPIDelegate::GenerateAppForLinkFunctionDelegate(
extensions::ManagementGenerateAppForLinkFunction* function,
content::BrowserContext* context,
@@ -280,7 +282,7 @@ ChromeManagementAPIDelegate::GenerateAppForLinkFunctionDelegate(
context, title, launch_url),
&delegate->cancelable_task_tracker_);
- return scoped_ptr<extensions::AppForLinkDelegate>(delegate);
+ return std::unique_ptr<extensions::AppForLinkDelegate>(delegate);
}
bool ChromeManagementAPIDelegate::CanHostedAppsOpenInWindows() const {

Powered by Google App Engine
This is Rietveld 408576698