| 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 ShellAppWindow; |
| 13 } |
| 14 |
| 11 namespace content { | 15 namespace content { |
| 12 class BrowserContext; | 16 class BrowserContext; |
| 13 } | 17 } |
| 14 | 18 |
| 15 namespace athena { | 19 namespace athena { |
| 16 class Activity; | 20 class Activity; |
| 17 | 21 |
| 18 class ATHENA_EXPORT ActivityFactory { | 22 class ATHENA_EXPORT ActivityFactory { |
| 19 public: | 23 public: |
| 20 // Registers the singleton factory. | 24 // Registers the singleton factory. |
| 21 static void RegisterActivityFactory(ActivityFactory* factory); | 25 static void RegisterActivityFactory(ActivityFactory* factory); |
| 22 | 26 |
| 23 // Gets the registered singleton factory. | 27 // Gets the registered singleton factory. |
| 24 static ActivityFactory* Get(); | 28 static ActivityFactory* Get(); |
| 25 | 29 |
| 26 // Shutdowns the factory. | 30 // Shutdowns the factory. |
| 27 static void Shutdown(); | 31 static void Shutdown(); |
| 28 | 32 |
| 29 virtual ~ActivityFactory() {} | 33 virtual ~ActivityFactory() {} |
| 30 | 34 |
| 31 // Create an activity of a web page. | 35 // Create an activity of a web page. |
| 32 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, | 36 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, |
| 33 const GURL& url) = 0; | 37 const GURL& url) = 0; |
| 34 | 38 |
| 35 // Create an activity of an app. | 39 // Create an activity of an app with |app_window|. The returned activity |
| 36 virtual Activity* CreateAppActivity(content::BrowserContext* browser_context, | 40 // should own |app_window|. |
| 37 const std::string& app_id) = 0; | 41 virtual Activity* CreateAppActivity(apps::ShellAppWindow* app_window) = 0; |
| 38 }; | 42 }; |
| 39 | 43 |
| 40 } // namespace athena | 44 } // namespace athena |
| 41 | 45 |
| 42 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ | 46 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ |
| OLD | NEW |