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 @@ ...@@ -11,8 +11,6 @@
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/metrics/histogram_macros.h" #include "base/metrics/histogram_macros.h"
#include "build/build_config.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/extension_util.h"
#include "chrome/browser/extensions/install_tracker_factory.h" #include "chrome/browser/extensions/install_tracker_factory.h"
#include "chrome/browser/extensions/launch_util.h" #include "chrome/browser/extensions/launch_util.h"
...@@ -129,10 +127,10 @@ void AppListControllerDelegate::DoShowAppInfoFlow( ...@@ -129,10 +127,10 @@ void AppListControllerDelegate::DoShowAppInfoFlow(
void AppListControllerDelegate::UninstallApp(Profile* profile, void AppListControllerDelegate::UninstallApp(Profile* profile,
const std::string& app_id) { const std::string& app_id) {
apps::AppServiceProxy* proxy = // ExtensionUninstall deletes itself when done or aborted.
apps::AppServiceProxyFactory::GetForProfile(profile); ExtensionUninstaller* uninstaller =
DCHECK(proxy); new ExtensionUninstaller(profile, app_id, GetAppListWindow());
proxy->Uninstall(app_id, GetAppListWindow()); uninstaller->Run();
} }
bool AppListControllerDelegate::IsAppFromWebStore(Profile* profile, bool AppListControllerDelegate::IsAppFromWebStore(Profile* profile,
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
#include "ash/public/cpp/tablet_mode.h" #include "ash/public/cpp/tablet_mode.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/feature_list.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/chromeos/arc/app_shortcuts/arc_app_shortcuts_menu_builder.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_context_menu_delegate.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) { ...@@ -91,11 +89,7 @@ void ArcAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
if (command_id == ash::LAUNCH_NEW) { if (command_id == ash::LAUNCH_NEW) {
delegate()->ExecuteLaunchCommand(event_flags); delegate()->ExecuteLaunchCommand(event_flags);
} else if (command_id == ash::UNINSTALL) { } else if (command_id == ash::UNINSTALL) {
apps::AppServiceProxy* proxy = arc::ShowArcAppUninstallDialog(profile(), controller(), app_id());
apps::AppServiceProxyFactory::GetForProfile(profile());
DCHECK(proxy);
proxy->Uninstall(app_id(),
controller() ? controller()->GetAppListWindow() : nullptr);
} else if (command_id == ash::SHOW_APP_INFO) { } else if (command_id == ash::SHOW_APP_INFO) {
ShowPackageInfo(); ShowPackageInfo();
} else if (command_id >= ash::LAUNCH_APP_SHORTCUT_FIRST && } else if (command_id >= ash::LAUNCH_APP_SHORTCUT_FIRST &&
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#include "ash/public/cpp/app_menu_constants.h" #include "ash/public/cpp/app_menu_constants.h"
#include "base/bind_helpers.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_manager.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h" #include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
...@@ -33,14 +31,11 @@ bool CrostiniAppContextMenu::IsCommandIdEnabled(int command_id) const { ...@@ -33,14 +31,11 @@ bool CrostiniAppContextMenu::IsCommandIdEnabled(int command_id) const {
void CrostiniAppContextMenu::ExecuteCommand(int command_id, int event_flags) { void CrostiniAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
switch (command_id) { switch (command_id) {
case ash::UNINSTALL: { case ash::UNINSTALL:
DCHECK_NE(app_id(), crostini::kCrostiniTerminalId); DCHECK_NE(app_id(), crostini::kCrostiniTerminalId);
apps::AppServiceProxy* proxy = crostini::ShowCrostiniAppUninstallerView(profile(), app_id());
apps::AppServiceProxyFactory::GetForProfile(profile());
DCHECK(proxy);
proxy->Uninstall(app_id(), nullptr /* parent_window */);
return; return;
}
case ash::STOP_APP: case ash::STOP_APP:
if (app_id() == crostini::kCrostiniTerminalId) { if (app_id() == crostini::kCrostiniTerminalId) {
crostini::CrostiniManager::GetForProfile(profile())->StopVm( crostini::CrostiniManager::GetForProfile(profile())->StopVm(
......
...@@ -67,6 +67,7 @@ void ArcLauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { ...@@ -67,6 +67,7 @@ void ArcLauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
return; return;
} }
if (command_id == ash::UNINSTALL) { if (command_id == ash::UNINSTALL) {
if (base::FeatureList::IsEnabled(features::kAppServiceShelf)) {
apps::AppServiceProxy* proxy = apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(controller()->profile()); apps::AppServiceProxyFactory::GetForProfile(controller()->profile());
DCHECK(proxy); DCHECK(proxy);
...@@ -74,6 +75,11 @@ void ArcLauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { ...@@ -74,6 +75,11 @@ void ArcLauncherContextMenu::ExecuteCommand(int command_id, int event_flags) {
return; return;
} }
arc::ShowArcAppUninstallDialog(controller()->profile(),
nullptr /* controller */, item().id.app_id);
return;
}
LauncherContextMenu::ExecuteCommand(command_id, event_flags); LauncherContextMenu::ExecuteCommand(command_id, event_flags);
} }
......
...@@ -10,8 +10,6 @@ ...@@ -10,8 +10,6 @@
#include "ash/public/cpp/app_menu_constants.h" #include "ash/public/cpp/app_menu_constants.h"
#include "ash/public/cpp/shelf_item.h" #include "ash/public/cpp/shelf_item.h"
#include "base/bind_helpers.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_manager.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service.h" #include "chrome/browser/chromeos/crostini/crostini_registry_service.h"
#include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h" #include "chrome/browser/chromeos/crostini/crostini_registry_service_factory.h"
...@@ -70,14 +68,11 @@ bool CrostiniShelfContextMenu::IsCommandIdEnabled(int command_id) const { ...@@ -70,14 +68,11 @@ bool CrostiniShelfContextMenu::IsCommandIdEnabled(int command_id) const {
void CrostiniShelfContextMenu::ExecuteCommand(int command_id, int event_flags) { void CrostiniShelfContextMenu::ExecuteCommand(int command_id, int event_flags) {
switch (command_id) { switch (command_id) {
case ash::UNINSTALL: { case ash::UNINSTALL:
DCHECK_NE(item().id.app_id, crostini::kCrostiniTerminalId); DCHECK_NE(item().id.app_id, crostini::kCrostiniTerminalId);
apps::AppServiceProxy* proxy = crostini::ShowCrostiniAppUninstallerView(controller()->profile(),
apps::AppServiceProxyFactory::GetForProfile(controller()->profile()); item().id.app_id);
DCHECK(proxy);
proxy->Uninstall(item().id.app_id, nullptr /* parent_window */);
return; return;
}
case ash::STOP_APP: case ash::STOP_APP:
if (item().id.app_id == crostini::kCrostiniTerminalId) { if (item().id.app_id == crostini::kCrostiniTerminalId) {
crostini::CrostiniManager::GetForProfile(controller()->profile()) 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