 Chromium Code Reviews
 Chromium Code Reviews Issue 1756193008:
  Support uninstalling ARC app from Chrome launcher  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1756193008:
  Support uninstalling ARC app from Chrome launcher  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 3535fd77b1291f5be071671d43a4528f5a2dd95e..98c8a1b3439aa91ae180fa2786210a34e54cb3d2 100644 | 
| --- a/chrome/browser/ui/app_list/arc/arc_app_utils.cc | 
| +++ b/chrome/browser/ui/app_list/arc/arc_app_utils.cc | 
| @@ -20,12 +20,12 @@ bool LaunchApp(content::BrowserContext* context, const std::string& app_id) { | 
| 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; | 
| } | 
| @@ -98,4 +98,29 @@ bool CanHandleResolution(content::BrowserContext* context, | 
| return true; | 
| } | 
| +bool UninstallApp(content::BrowserContext* context, | 
| + const std::string& package_name) { | 
| + arc::ArcBridgeService* bridge_service = arc::ArcBridgeService::Get(); | 
| + if (!bridge_service) { | 
| + VLOG(2) << "Request to uninstall app when bridge service is not ready: " | 
| + << package_name << "."; | 
| + return false; | 
| + } | 
| + arc::AppInstance* app_instance = bridge_service->app_instance(); | 
| + if (!app_instance) { | 
| + VLOG(2) << "Request to uninstall app when bridge service is not ready: " | 
| + << package_name << "."; | 
| + return false; | 
| + } | 
| + | 
| + if (bridge_service->app_version() >= 2) { | 
| 
khmel
2016/03/04 18:35:53
If you have UninstallApp available you already hav
 
Luis Héctor Chávez
2016/03/04 21:29:37
You will always have the method available (compile
 
victorhsieh0
2016/03/07 21:00:16
Done.
 | 
| + app_instance->UninstallApp(package_name); | 
| + } else { | 
| + LOG(ERROR) << "Require later version to uninstall"; | 
| + return false; | 
| + } | 
| + | 
| + return true; | 
| +} | 
| + | 
| } // namespace arc |