| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 215 |
| 216 bool LaunchApp(content::BrowserContext* context, | 216 bool LaunchApp(content::BrowserContext* context, |
| 217 const std::string& app_id, | 217 const std::string& app_id, |
| 218 bool landscape_layout) { | 218 bool landscape_layout) { |
| 219 const ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context); | 219 const ArcAppListPrefs* prefs = ArcAppListPrefs::Get(context); |
| 220 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); | 220 std::unique_ptr<ArcAppListPrefs::AppInfo> app_info = prefs->GetApp(app_id); |
| 221 if (app_info && !app_info->ready) { | 221 if (app_info && !app_info->ready) { |
| 222 if (!ash::Shell::HasInstance()) | 222 if (!ash::Shell::HasInstance()) |
| 223 return false; | 223 return false; |
| 224 | 224 |
| 225 ArcAuthService* auth_service = ArcAuthService::Get(); |
| 226 DCHECK(auth_service); |
| 227 |
| 228 if (!auth_service->IsArcEnabled()) { |
| 229 auth_service->EnableArc(); |
| 230 if (!auth_service->IsArcEnabled()) { |
| 231 NOTREACHED(); |
| 232 return false; |
| 233 } |
| 234 } |
| 235 |
| 225 ChromeLauncherController* chrome_controller = | 236 ChromeLauncherController* chrome_controller = |
| 226 ChromeLauncherController::instance(); | 237 ChromeLauncherController::instance(); |
| 227 DCHECK(chrome_controller); | 238 DCHECK(chrome_controller); |
| 228 chrome_controller->GetArcDeferredLauncher()->RegisterDeferredLaunch(app_id); | 239 chrome_controller->GetArcDeferredLauncher()->RegisterDeferredLaunch(app_id); |
| 229 return true; | 240 return true; |
| 230 } | 241 } |
| 231 | 242 |
| 232 return (new LaunchAppWithoutSize(context, app_id, landscape_layout)) | 243 return (new LaunchAppWithoutSize(context, app_id, landscape_layout)) |
| 233 ->LaunchAndRelease(); | 244 ->LaunchAndRelease(); |
| 234 } | 245 } |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 if (!app_instance) | 337 if (!app_instance) |
| 327 return false; | 338 return false; |
| 328 | 339 |
| 329 app_instance->ShowPackageInfoOnPage( | 340 app_instance->ShowPackageInfoOnPage( |
| 330 package_name, page, | 341 package_name, page, |
| 331 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); | 342 GetTargetRect(gfx::Size(kNexus7Width, kNexus7Height))); |
| 332 return true; | 343 return true; |
| 333 } | 344 } |
| 334 | 345 |
| 335 } // namespace arc | 346 } // namespace arc |
| OLD | NEW |