Commit 3bdce7c8 authored by Christian Dullweber's avatar Christian Dullweber Committed by Commit Bot

Revert "Use AppService to uninstall apps on Chrome OS."

This reverts commit c7d42e29.

Reason for revert: Suspected to break AppListClientImplBrowserTest.UninstallApp
https://ci.chromium.org/p/chrome/builders/ci/linux-chromeos-google-rel/8074

Original change's description:
> Use AppService to uninstall apps on Chrome OS.
> 
> BUG=1009248
> 
> Change-Id: I659067359fbdb5fb430f9dcb60a0dbee1fcf6184
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1864496
> Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
> Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#708514}

TBR=xiyuan@chromium.org,nancylingwang@chromium.org

Change-Id: I94e44362796779c94b75e37e6457288aef92ca55
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1009248
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1875093Reviewed-by: default avatarChristian Dullweber <dullweber@chromium.org>
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708544}
parent 39a49206
......@@ -11,8 +11,6 @@
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/install_tracker_factory.h"
#include "chrome/browser/extensions/launch_util.h"
......@@ -129,10 +127,10 @@ void AppListControllerDelegate::DoShowAppInfoFlow(
void AppListControllerDelegate::UninstallApp(Profile* profile,
const std::string& app_id) {
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile);
DCHECK(proxy);
proxy->Uninstall(app_id, GetAppListWindow());
// ExtensionUninstall deletes itself when done or aborted.
ExtensionUninstaller* uninstaller =
new ExtensionUninstaller(profile, app_id, GetAppListWindow());
uninstaller->Run();
}
bool AppListControllerDelegate::IsAppFromWebStore(Profile* profile,
......
......@@ -9,8 +9,6 @@
#include "ash/public/cpp/tablet_mode.h"
#include "base/bind.h"
#include "base/feature_list.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/chromeos/arc/app_shortcuts/arc_app_shortcuts_menu_builder.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_context_menu_delegate.h"
......@@ -91,11 +89,7 @@ void ArcAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
if (command_id == ash::LAUNCH_NEW) {
delegate()->ExecuteLaunchCommand(event_flags);
} else if (command_id == ash::UNINSTALL) {
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile());
DCHECK(proxy);
proxy->Uninstall(app_id(),
controller() ? controller()->GetAppListWindow() : nullptr);
arc::ShowArcAppUninstallDialog(profile(), controller(), app_id());
} else if (command_id == ash::SHOW_APP_INFO) {
ShowPackageInfo();
} else if (command_id >= ash::LAUNCH_APP_SHORTCUT_FIRST &&
......
......@@ -6,8 +6,6 @@
#include "ash/public/cpp/app_menu_constants.h"
#include "base/bind_helpers.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/chromeos/crostini/crostini_manager.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/grit/generated_resources.h"
......@@ -33,14 +31,11 @@ bool CrostiniAppContextMenu::IsCommandIdEnabled(int command_id) const {
void CrostiniAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
switch (command_id) {
case ash::UNINSTALL: {
case ash::UNINSTALL:
DCHECK_NE(app_id(), crostini::kCrostiniTerminalId);
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile());
DCHECK(proxy);
proxy->Uninstall(app_id(), nullptr /* parent_window */);
crostini::ShowCrostiniAppUninstallerView(profile(), app_id());
return;
}
case ash::STOP_APP:
if (app_id() == crostini::kCrostiniTerminalId) {
crostini::CrostiniManager::GetForProfile(profile())->StopVm(
......
......@@ -67,10 +67,16 @@ void ArcLauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
return;
}
if (command_id == ash::UNINSTALL) {
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(controller()->profile());
DCHECK(proxy);
proxy->Uninstall(item().id.app_id, nullptr /* parent_window */);
if (base::FeatureList::IsEnabled(features::kAppServiceShelf)) {
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(controller()->profile());
DCHECK(proxy);
proxy->Uninstall(item().id.app_id, nullptr /* parent_window */);
return;
}
arc::ShowArcAppUninstallDialog(controller()->profile(),
nullptr /* controller */, item().id.app_id);
return;
}
......
......@@ -10,8 +10,6 @@
#include "ash/public/cpp/app_menu_constants.h"
#include "ash/public/cpp/shelf_item.h"
#include "base/bind_helpers.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/chromeos/crostini/crostini_manager.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h"
......@@ -70,14 +68,11 @@ bool CrostiniShelfContextMenu::IsCommandIdEnabled(int command_id) const {
void CrostiniShelfContextMenu::ExecuteCommand(int command_id, int event_flags) {
switch (command_id) {
case ash::UNINSTALL: {
case ash::UNINSTALL:
DCHECK_NE(item().id.app_id, crostini::kCrostiniTerminalId);
apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(controller()->profile());
DCHECK(proxy);
proxy->Uninstall(item().id.app_id, nullptr /* parent_window */);
crostini::ShowCrostiniAppUninstallerView(controller()->profile(),
item().id.app_id);
return;
}
case ash::STOP_APP:
if (item().id.app_id == crostini::kCrostiniTerminalId) {
crostini::CrostiniManager::GetForProfile(controller()->profile())
......
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