1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/app_list/extension_uninstaller.h"
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
9 #include "extensions/browser/extension_registry.h"
10 #include "extensions/browser/uninstall_reason.h"
11 #include "extensions/common/extension.h"
13 ExtensionUninstaller::ExtensionUninstaller(
15 const std::string
& extension_id
,
16 AppListControllerDelegate
* controller
)
18 app_id_(extension_id
),
19 controller_(controller
) {
22 ExtensionUninstaller::~ExtensionUninstaller() {
25 void ExtensionUninstaller::Run() {
26 const extensions::Extension
* extension
=
27 extensions::ExtensionRegistry::Get(profile_
)->GetInstalledExtension(
33 controller_
->OnShowChildDialog();
34 dialog_
.reset(extensions::ExtensionUninstallDialog::Create(
35 profile_
, controller_
->GetAppListWindow(), this));
36 dialog_
->ConfirmUninstall(extension
,
37 extensions::UNINSTALL_REASON_USER_INITIATED
,
38 extensions::UNINSTALL_SOURCE_APP_LIST
);
41 void ExtensionUninstaller::OnExtensionUninstallDialogClosed(
42 bool did_start_uninstall
,
43 const base::string16
& error
) {
44 controller_
->OnCloseChildDialog();
48 void ExtensionUninstaller::CleanUp() {