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

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

Issue 1756193008: Support uninstalling ARC app from Chrome launcher (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 9 months 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') | components/arc/common/app.mojom » ('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 2afa157fc2831f32a309051b2d85d5c3b4631b09..ad6a80cb37ab418317416adc632b86b9e1a1570f 100644
--- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc
+++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc
@@ -128,12 +128,12 @@ bool LaunchAppWithRect(content::BrowserContext* context,
scoped_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id);
if (!app_info) {
- VLOG(2) << "Cannot launch unavailable app:" << app_id << ".";
+ VLOG(2) << "Cannot launch unavailable app: " << app_id << ".";
return false;
}
if (!app_info->ready) {
- VLOG(2) << "Cannot launch not-ready app:" << app_id << ".";
+ VLOG(2) << "Cannot launch not-ready app: " << app_id << ".";
return false;
}
@@ -170,7 +170,7 @@ bool LaunchApp(content::BrowserContext* context, const std::string& app_id) {
bool CanHandleResolution(content::BrowserContext* context,
const std::string& app_id,
const gfx::Rect& rect,
- const CanHandleResolutionCallback callback) {
+ const CanHandleResolutionCallback& callback) {
ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context);
scoped_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id);
if (!app_info) {
@@ -207,4 +207,27 @@ bool CanHandleResolution(content::BrowserContext* context,
return true;
}
+void UninstallPackage(const std::string& package_name) {
+ VLOG(2) << "Uninstalling " << package_name;
+ arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get();
+ if (!bridge_service) {
+ VLOG(2) << "Request to uninstall package when bridge service is not ready: "
+ << package_name << ".";
+ return;
+ }
+ arc::AppInstance* app_instance = bridge_service->app_instance();
+ if (!app_instance) {
+ VLOG(2) << "Request to uninstall package when bridge service is not ready: "
+ << package_name << ".";
+ return;
+ }
+
+ if (bridge_service->app_version() < 2) {
+ LOG(ERROR) << "Request to uninstall package when version "
+ << bridge_service->app_version() << " does not support it";
+ return;
+ }
+ app_instance->UninstallPackage(package_name);
+}
+
} // namespace arc
« no previous file with comments | « chrome/browser/ui/app_list/arc/arc_app_utils.h ('k') | components/arc/common/app.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698