 Chromium Code Reviews
 Chromium Code Reviews Issue 2496903003:
  arc: Add Arc Kiosk app service and ability to launch kiosk apps.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@policy_comp_parse
    
  
    Issue 2496903003:
  arc: Add Arc Kiosk app service and ability to launch kiosk apps.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@policy_comp_parse| Index: chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service_factory.cc | 
| diff --git a/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service_factory.cc b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service_factory.cc | 
| new file mode 100644 | 
| index 0000000000000000000000000000000000000000..cc7a51ffa88cb0662a2b9ecb22a72594718f913c | 
| --- /dev/null | 
| +++ b/chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service_factory.cc | 
| @@ -0,0 +1,43 @@ | 
| +// Copyright 2016 The Chromium Authors. All rights reserved. | 
| +// Use of this source code is governed by a BSD-style license that can be | 
| +// found in the LICENSE file. | 
| + | 
| +#include <chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service_factory.h> | 
| + | 
| +#include "chrome/browser/chromeos/app_mode/arc/arc_kiosk_app_service.h" | 
| +#include "chrome/browser/profiles/profile.h" | 
| +#include "chrome/browser/ui/app_list/arc/arc_app_list_prefs_factory.h" | 
| +#include "components/keyed_service/content/browser_context_dependency_manager.h" | 
| + | 
| +namespace chromeos { | 
| + | 
| +// static | 
| +ArcKioskAppService* ArcKioskAppServiceFactory::GetForBrowserContext( | 
| + content::BrowserContext* context) { | 
| + return static_cast<ArcKioskAppService*>( | 
| + GetInstance()->GetServiceForBrowserContext(context, true /* create */)); | 
| +} | 
| + | 
| +// static | 
| +ArcKioskAppServiceFactory* ArcKioskAppServiceFactory::GetInstance() { | 
| + return base::Singleton<ArcKioskAppServiceFactory>::get(); | 
| +} | 
| + | 
| +ArcKioskAppServiceFactory::ArcKioskAppServiceFactory() | 
| + : BrowserContextKeyedServiceFactory( | 
| + "ArcKioskAppService", | 
| + BrowserContextDependencyManager::GetInstance()) { | 
| + DependsOn(ArcAppListPrefsFactory::GetInstance()); | 
| +} | 
| + | 
| +ArcKioskAppServiceFactory::~ArcKioskAppServiceFactory() {} | 
| 
Luis Héctor Chávez
2016/11/16 16:37:12
nit: = default
 
Sergey Poromov
2016/11/16 17:42:14
Done.
 | 
| + | 
| +KeyedService* ArcKioskAppServiceFactory::BuildServiceInstanceFor( | 
| + content::BrowserContext* context) const { | 
| + Profile* profile = static_cast<Profile*>(context); | 
| + DCHECK(profile); | 
| + | 
| + return ArcKioskAppService::Create(profile, ArcAppListPrefs::Get(profile)); | 
| +} | 
| + | 
| +} // namespace chromeos |