| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ | 5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ |
| 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ | 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ |
| 7 | 7 |
| 8 #include "athena/athena_export.h" | 8 #include "athena/athena_export.h" |
| 9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
| 10 | 10 |
| 11 namespace apps { |
| 12 class AppWindow; |
| 13 } |
| 14 |
| 11 namespace content { | 15 namespace content { |
| 12 class BrowserContext; | 16 class BrowserContext; |
| 13 } | 17 } |
| 14 | 18 |
| 15 namespace extensions { | 19 namespace extensions { |
| 16 class ShellAppWindow; | 20 class ShellAppWindow; |
| 17 } | 21 } |
| 18 | 22 |
| 19 namespace athena { | 23 namespace athena { |
| 20 class Activity; | 24 class Activity; |
| 21 | 25 |
| 22 class ATHENA_EXPORT ActivityFactory { | 26 class ATHENA_EXPORT ActivityFactory { |
| 23 public: | 27 public: |
| 24 // Registers the singleton factory. | 28 // Registers the singleton factory. |
| 25 static void RegisterActivityFactory(ActivityFactory* factory); | 29 static void RegisterActivityFactory(ActivityFactory* factory); |
| 26 | 30 |
| 27 // Gets the registered singleton factory. | 31 // Gets the registered singleton factory. |
| 28 static ActivityFactory* Get(); | 32 static ActivityFactory* Get(); |
| 29 | 33 |
| 30 // Shutdowns the factory. | 34 // Shutdowns the factory. |
| 31 static void Shutdown(); | 35 static void Shutdown(); |
| 32 | 36 |
| 33 virtual ~ActivityFactory() {} | 37 virtual ~ActivityFactory() {} |
| 34 | 38 |
| 35 // Create an activity of a web page. | 39 // Create an activity of a web page. |
| 36 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, | 40 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, |
| 37 const GURL& url) = 0; | 41 const GURL& url) = 0; |
| 38 | 42 |
| 39 // Create an activity of an app with |app_window|. The returned activity | 43 // Create an activity of an app with |app_window| for app shell environemnt. |
| 40 // should own |app_window|. | 44 // The returned activity should own |app_window|. |
| 45 // TODO(oshima): Consolidate these two methods to create AppActivity |
| 46 // once crbug.com/403726 is finished. |
| 41 virtual Activity* CreateAppActivity( | 47 virtual Activity* CreateAppActivity( |
| 42 extensions::ShellAppWindow* app_window) = 0; | 48 extensions::ShellAppWindow* app_window) = 0; |
| 49 |
| 50 // Create an activity of an app with |app_window| for chrome environment. |
| 51 virtual Activity* CreateAppActivity(apps::AppWindow* app_window) = 0; |
| 43 }; | 52 }; |
| 44 | 53 |
| 45 } // namespace athena | 54 } // namespace athena |
| 46 | 55 |
| 47 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ | 56 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ |
| OLD | NEW |