| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" | 5 #include "chrome/browser/ui/app_list/arc/arc_app_utils.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 if (!app_info) { | 175 if (!app_info) { |
| 176 VLOG(2) << "Cannot launch unavailable app: " << app_id << "."; | 176 VLOG(2) << "Cannot launch unavailable app: " << app_id << "."; |
| 177 return false; | 177 return false; |
| 178 } | 178 } |
| 179 | 179 |
| 180 if (!app_info->ready) { | 180 if (!app_info->ready) { |
| 181 VLOG(2) << "Cannot launch not-ready app: " << app_id << "."; | 181 VLOG(2) << "Cannot launch not-ready app: " << app_id << "."; |
| 182 return false; | 182 return false; |
| 183 } | 183 } |
| 184 | 184 |
| 185 if (!app_info->launchable) { |
| 186 VLOG(2) << "Cannot launch non-launchable app: " << app_id << "."; |
| 187 return false; |
| 188 } |
| 189 |
| 185 arc::mojom::AppInstance* app_instance = | 190 arc::mojom::AppInstance* app_instance = |
| 186 GetAppInstance(kMinVersion, kLaunchAppStr); | 191 GetAppInstance(kMinVersion, kLaunchAppStr); |
| 187 if (!app_instance) | 192 if (!app_instance) |
| 188 return false; | 193 return false; |
| 189 | 194 |
| 190 if (app_info->shortcut) { | 195 if (app_info->shortcut) { |
| 191 app_instance->LaunchIntent(app_info->intent_uri, target_rect); | 196 app_instance->LaunchIntent(app_info->intent_uri, target_rect); |
| 192 } else { | 197 } else { |
| 193 app_instance->LaunchApp(app_info->package_name, app_info->activity, | 198 app_instance->LaunchApp(app_info->package_name, app_info->activity, |
| 194 target_rect); | 199 target_rect); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 if (!app_instance) | 300 if (!app_instance) |
| 296 return false; | 301 return false; |
| 297 | 302 |
| 298 app_instance->ShowPackageInfoOnPage( | 303 app_instance->ShowPackageInfoOnPage( |
| 299 package_name, page, | 304 package_name, page, |
| 300 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); | 305 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); |
| 301 return true; | 306 return true; |
| 302 } | 307 } |
| 303 | 308 |
| 304 } // namespace arc | 309 } // namespace arc |
| OLD | NEW |