Commit 5329f385 authored by nancy's avatar nancy Committed by Commit Bot

Remove ExtensionUninstaller

AppUninstallDialogView replaced ExtensionUninstaller, so
ExtensionUninstaller can be removed.
https://cs.chromium.org/chromium/src/chrome/browser/ui/views/apps/app_uninstall_dialog_view.h?l=44

BUG=1010303

Change-Id: I215dad0977b2d37bc126ac68e06689eb0a3b0c3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2076857Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745216}
parent bee7bee6
......@@ -3729,8 +3729,6 @@ jumbo_static_library("ui") {
"app_list/extension_app_item.h",
"app_list/extension_app_utils.cc",
"app_list/extension_app_utils.h",
"app_list/extension_uninstaller.cc",
"app_list/extension_uninstaller.h",
"app_list/internal_app/internal_app_context_menu.cc",
"app_list/internal_app/internal_app_context_menu.h",
"app_list/internal_app/internal_app_metadata.cc",
......
......@@ -18,7 +18,6 @@
#include "chrome/browser/extensions/install_tracker_factory.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/extension_uninstaller.h"
#include "chrome/browser/ui/apps/app_info_dialog.h"
#include "chrome/browser/ui/ash/tablet_mode_page_behavior.h"
#include "chrome/browser/ui/chrome_pages.h"
......
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/app_list/extension_uninstaller.h"
#include <string>
#include "chrome/browser/profiles/profile.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/extension.h"
ExtensionUninstaller::ExtensionUninstaller(Profile* profile,
const std::string& extension_id,
gfx::NativeWindow parent_window)
: profile_(profile), app_id_(extension_id), parent_window_(parent_window) {}
ExtensionUninstaller::~ExtensionUninstaller() {
}
void ExtensionUninstaller::Run() {
const extensions::Extension* extension =
extensions::ExtensionRegistry::Get(profile_)->GetInstalledExtension(
app_id_);
if (!extension) {
CleanUp();
return;
}
dialog_ = extensions::ExtensionUninstallDialog::Create(profile_,
parent_window_, this);
dialog_->ConfirmUninstall(extension,
extensions::UNINSTALL_REASON_USER_INITIATED,
extensions::UNINSTALL_SOURCE_APP_LIST);
}
void ExtensionUninstaller::OnExtensionUninstallDialogClosed(
bool did_start_uninstall,
const base::string16& error) {
CleanUp();
}
void ExtensionUninstaller::CleanUp() {
delete this;
}
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_APP_LIST_EXTENSION_UNINSTALLER_H_
#define CHROME_BROWSER_UI_APP_LIST_EXTENSION_UNINSTALLER_H_
#include "base/macros.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "ui/gfx/native_widget_types.h"
class Profile;
// ExtensionUninstaller runs the extension uninstall flow. It shows the
// extension uninstall dialog and wait for user to confirm or cancel the
// uninstall.
class ExtensionUninstaller
: public extensions::ExtensionUninstallDialog::Delegate {
public:
// If |parent_window| is specified, the uninstall dialog will be created as a
// modal dialog anchored at |parent_window|. Otherwise, the browser
// window will be used as the anchor.
ExtensionUninstaller(Profile* profile,
const std::string& extension_id,
gfx::NativeWindow parent_window = nullptr);
~ExtensionUninstaller() override;
void Run();
private:
// Overridden from ExtensionUninstallDialog::Delegate:
void OnExtensionUninstallDialogClosed(bool did_start_uninstall,
const base::string16& error) override;
void CleanUp();
Profile* profile_;
std::string app_id_;
gfx::NativeWindow parent_window_; // Can be null.
std::unique_ptr<extensions::ExtensionUninstallDialog> dialog_;
DISALLOW_COPY_AND_ASSIGN(ExtensionUninstaller);
};
#endif // CHROME_BROWSER_UI_APP_LIST_EXTENSION_UNINSTALLER_H_
......@@ -18,7 +18,6 @@
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/app_list/extension_uninstaller.h"
#include "chrome/browser/ui/app_list/internal_app/internal_app_metadata.h"
#include "chrome/browser/ui/ash/launcher/app_service/app_service_shelf_context_menu.h"
#include "chrome/browser/ui/ash/launcher/arc_shelf_context_menu.h"
......
......@@ -8,7 +8,6 @@
#include "ash/public/cpp/app_menu_constants.h"
#include "ash/public/cpp/shelf_item.h"
#include "base/macros.h"
#include "chrome/browser/ui/app_list/extension_uninstaller.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/gfx/vector_icon_types.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment