| Index: chrome/browser/ui/app_list/arc/arc_app_utils.cc
|
| diff --git a/chrome/browser/ui/app_list/arc/arc_app_utils.cc b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
|
| index 12b6727d88b417654d242a7ce1b19c0b02c59981..247725811e668ad61031ebe404d9f5f033e74c5b 100644
|
| --- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
|
| +++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
|
| @@ -12,6 +12,7 @@
|
| #include "base/json/json_writer.h"
|
| #include "base/synchronization/waitable_event.h"
|
| #include "base/values.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
|
| #include "chrome/browser/ui/ash/launcher/arc_app_deferred_launcher_controller.h"
|
| #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
|
| @@ -392,6 +393,22 @@ void UninstallPackage(const std::string& package_name) {
|
| app_instance->UninstallPackage(package_name);
|
| }
|
|
|
| +void UninstallArcApp(const std::string& app_id, Profile* profile) {
|
| + ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile);
|
| + DCHECK(arc_prefs);
|
| + std::unique_ptr<ArcAppListPrefs::AppInfo> app_info =
|
| + arc_prefs->GetApp(app_id);
|
| + if (!app_info) {
|
| + VLOG(2) << "Package being uninstalled does not exist: " << app_id << ".";
|
| + return;
|
| + }
|
| + // For shortcut we just remove the shortcut instead of the package.
|
| + if (app_info->shortcut)
|
| + arc_prefs->RemoveApp(app_id);
|
| + else
|
| + UninstallPackage(app_info->package_name);
|
| +}
|
| +
|
| void RemoveCachedIcon(const std::string& icon_resource_id) {
|
| VLOG(2) << "Removing icon " << icon_resource_id;
|
|
|
|
|