1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ 7 8 #include "athena/athena_export.h" 9 #include "url/gurl.h" 10 11 namespace apps { 12 class ShellAppWindow; 13 } 14 15 namespace content { 16 class BrowserContext; 17 } 18 19 namespace athena { 20 class Activity; 21 22 class ATHENA_EXPORT ActivityFactory { 23 public: 24 // Registers the singleton factory. 25 static void RegisterActivityFactory(ActivityFactory* factory); 26 27 // Gets the registered singleton factory. 28 static ActivityFactory* Get(); 29 30 // Shutdowns the factory. 31 static void Shutdown(); 32 ~ActivityFactory()33 virtual ~ActivityFactory() {} 34 35 // Create an activity of a web page. 36 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, 37 const GURL& url) = 0; 38 39 // Create an activity of an app with |app_window|. The returned activity 40 // should own |app_window|. 41 virtual Activity* CreateAppActivity(apps::ShellAppWindow* app_window) = 0; 42 }; 43 44 } // namespace athena 45 46 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ 47