| 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 f23350b69c8119c24814b2027dbcd0059aae42f2..2e7ccd7d8e109c67186d9dcc616dfdb6b0e8fc56 100644
|
| --- a/chrome/browser/extensions/extension_disabled_ui.cc
|
| +++ b/chrome/browser/extensions/extension_disabled_ui.cc
|
| @@ -430,13 +430,14 @@ void ExtensionDisabledGlobalError::OnShutdown(
|
| }
|
|
|
| void ExtensionDisabledGlobalError::RemoveGlobalError() {
|
| - GlobalErrorServiceFactory::GetForProfile(service_->profile())
|
| - ->RemoveGlobalError(this);
|
| + std::unique_ptr<GlobalError> ptr =
|
| + GlobalErrorServiceFactory::GetForProfile(service_->profile())
|
| + ->RemoveOwnedGlobalError(this);
|
| registrar_.RemoveAll();
|
| registry_observer_.RemoveAll();
|
| // Delete this object after any running tasks, so that the extension dialog
|
| // still has it as a delegate to finish the current tasks.
|
| - base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
|
| + base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, ptr.release());
|
| }
|
|
|
| // Globals --------------------------------------------------------------------
|
| @@ -452,7 +453,7 @@ void AddExtensionDisabledErrorWithIcon(base::WeakPtr<ExtensionService> service,
|
| const Extension* extension = service->GetInstalledExtension(extension_id);
|
| if (extension) {
|
| GlobalErrorServiceFactory::GetForProfile(service->profile())
|
| - ->AddGlobalError(new ExtensionDisabledGlobalError(
|
| + ->AddOwnedGlobalError(base::MakeUnique<ExtensionDisabledGlobalError>(
|
| service.get(), extension, is_remote_install, icon));
|
| }
|
| }
|
|
|