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

Unified Diff: chrome/browser/extensions/extension_disabled_ui.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/extension_disabled_ui.cc
diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc
index bf81cb522f8a5676af831ff6d17d726db790b157..1773714184313f6b494350426ed675c8326c175c 100644
--- a/chrome/browser/extensions/extension_disabled_ui.cc
+++ b/chrome/browser/extensions/extension_disabled_ui.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/extensions/extension_disabled_ui.h"
#include <bitset>
+#include <memory>
#include <string>
#include <utility>
@@ -12,8 +13,8 @@
#include "base/lazy_instance.h"
#include "base/location.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram.h"
#include "base/scoped_observer.h"
#include "base/single_thread_task_runner.h"
@@ -71,9 +72,10 @@ static const int kIconSize = extension_misc::EXTENSION_ICON_SMALL;
class ExtensionDisabledDialogDelegate {
public:
- ExtensionDisabledDialogDelegate(ExtensionService* service,
- scoped_ptr<ExtensionInstallPrompt> install_ui,
- const Extension* extension);
+ ExtensionDisabledDialogDelegate(
+ ExtensionService* service,
+ std::unique_ptr<ExtensionInstallPrompt> install_ui,
+ const Extension* extension);
private:
~ExtensionDisabledDialogDelegate();
@@ -81,7 +83,7 @@ class ExtensionDisabledDialogDelegate {
void InstallPromptDone(ExtensionInstallPrompt::Result result);
// The UI for showing the install dialog when enabling.
- scoped_ptr<ExtensionInstallPrompt> install_ui_;
+ std::unique_ptr<ExtensionInstallPrompt> install_ui_;
ExtensionService* service_;
const Extension* extension_;
@@ -91,7 +93,7 @@ class ExtensionDisabledDialogDelegate {
ExtensionDisabledDialogDelegate::ExtensionDisabledDialogDelegate(
ExtensionService* service,
- scoped_ptr<ExtensionInstallPrompt> install_ui,
+ std::unique_ptr<ExtensionInstallPrompt> install_ui,
const Extension* extension)
: install_ui_(std::move(install_ui)),
service_(service),
@@ -105,7 +107,7 @@ ExtensionDisabledDialogDelegate::ExtensionDisabledDialogDelegate(
base::Bind(&ExtensionDisabledDialogDelegate::InstallPromptDone,
base::Unretained(this)),
extension_, nullptr,
- make_scoped_ptr(new ExtensionInstallPrompt::Prompt(type)),
+ base::WrapUnique(new ExtensionInstallPrompt::Prompt(type)),
ExtensionInstallPrompt::GetDefaultShowDialogCallback());
}
@@ -191,7 +193,7 @@ class ExtensionDisabledGlobalError
};
UserResponse user_response_;
- scoped_ptr<extensions::ExtensionUninstallDialog> uninstall_dialog_;
+ std::unique_ptr<extensions::ExtensionUninstallDialog> uninstall_dialog_;
// Helper to get menu command ID assigned for this extension's error.
extensions::ExtensionInstallErrorMenuItemIdProvider id_provider_;
@@ -494,7 +496,7 @@ void AddExtensionDisabledError(ExtensionService* service,
void ShowExtensionDisabledDialog(ExtensionService* service,
content::WebContents* web_contents,
const Extension* extension) {
- scoped_ptr<ExtensionInstallPrompt> install_ui(
+ std::unique_ptr<ExtensionInstallPrompt> install_ui(
new ExtensionInstallPrompt(web_contents));
// This object manages its own lifetime.
new ExtensionDisabledDialogDelegate(service, std::move(install_ui),

Powered by Google App Engine
This is Rietveld 408576698