Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_utils.cc

Issue 2529783002: arc: Implement uninstall confirmation dialog for Arc app. (Closed)
Patch Set: Address Mike's comments. Run git cl format. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 a120f6474a876159f94a80c28195ebb249bf404c..39fd1e1b66ebcabd010b0065d3b83792c0a714b3 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -10,6 +10,7 @@
#include "ash/shell.h"
#include "base/bind.h"
#include "base/synchronization/waitable_event.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"
@@ -339,6 +340,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;

Powered by Google App Engine
This is Rietveld 408576698