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

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 minor comments. Rebase. 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
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_utils.h ('k') | chrome/browser/ui/views/arc_app_dialog_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_utils.h ('k') | chrome/browser/ui/views/arc_app_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698