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

Unified Diff: chrome/browser/ui/app_list/arc/arc_app_context_menu.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
Index: chrome/browser/ui/app_list/arc/arc_app_context_menu.cc
diff --git a/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc b/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc
index ea1dd53efc8d65dc6afff2122ec3f4d8dcfb8507..961673c45abe665f2bbd0e1c14b0cab4a620d299 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_context_menu.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/ui/app_list/arc/arc_app_context_menu.h"
+#include "base/bind.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_list_controller_delegate.h"
+#include "chrome/browser/ui/app_list/arc/arc_app_dialog.h"
#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
#include "chrome/browser/ui/app_list/arc/arc_app_utils.h"
#include "chrome/browser/ui/ash/launcher/arc_app_window_launcher_controller.h"
@@ -82,7 +84,7 @@ void ArcAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
ArcAppWindowLauncherController::GetShelfAppIdFromArcAppId(app_id()));
break;
case UNINSTALL:
- UninstallPackage();
+ arc::ShowArcAppUninstallDialog(profile(), controller(), app_id());
break;
case SHOW_APP_INFO:
ShowPackageInfo();
@@ -92,23 +94,6 @@ void ArcAppContextMenu::ExecuteCommand(int command_id, int event_flags) {
}
}
-void ArcAppContextMenu::UninstallPackage() {
- 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;
- }
- if (app_info->shortcut) {
- // for shortcut we just remove the shortcut instead of the package
- arc_prefs->RemoveApp(app_id());
- } else {
- arc::UninstallPackage(app_info->package_name);
- }
-}
-
void ArcAppContextMenu::ShowPackageInfo() {
const ArcAppListPrefs* arc_prefs = ArcAppListPrefs::Get(profile());
DCHECK(arc_prefs);
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_context_menu.h ('k') | chrome/browser/ui/app_list/arc/arc_app_dialog.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698