Commit c42512af authored by nancy's avatar nancy Committed by Commit Bot

Use AppService Uninstall to uninstall ARC apps.

BUG=1009248

Change-Id: I0aca18b0a9cf6fc3dc72b4ec0cf1f33451279acf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863062Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706623}
parent 8dcb4c4a
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#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 "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_list_controller_delegate.h" #include "chrome/browser/ui/app_list/app_list_controller_delegate.h"
...@@ -65,6 +67,14 @@ void ArcLauncherContextMenu::ExecuteCommand(int command_id, int event_flags) { ...@@ -65,6 +67,14 @@ 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::AppServiceProxyFactory::GetForProfile(controller()->profile());
DCHECK(proxy);
proxy->Uninstall(item().id.app_id);
return;
}
arc::ShowArcAppUninstallDialog(controller()->profile(), arc::ShowArcAppUninstallDialog(controller()->profile(),
nullptr /* controller */, item().id.app_id); nullptr /* controller */, item().id.app_id);
return; return;
......
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