| 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 content { | 11 namespace content { |
| 12 class BrowserContext; | 12 class BrowserContext; |
| 13 } | 13 } |
| 14 | 14 |
| 15 namespace extensions { | 15 namespace extensions { |
| 16 class AppWindow; | 16 class AppWindow; |
| 17 class ShellAppWindow; | |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace views { | 19 namespace views { |
| 21 class WebView; | 20 class WebView; |
| 22 } | 21 } |
| 23 | 22 |
| 24 namespace athena { | 23 namespace athena { |
| 25 class Activity; | 24 class Activity; |
| 26 | 25 |
| 27 class ATHENA_EXPORT ActivityFactory { | 26 class ATHENA_EXPORT ActivityFactory { |
| 28 public: | 27 public: |
| 29 // Registers the singleton factory. | 28 // Registers the singleton factory. |
| 30 static void RegisterActivityFactory(ActivityFactory* factory); | 29 static void RegisterActivityFactory(ActivityFactory* factory); |
| 31 | 30 |
| 32 // Gets the registered singleton factory. | 31 // Gets the registered singleton factory. |
| 33 static ActivityFactory* Get(); | 32 static ActivityFactory* Get(); |
| 34 | 33 |
| 35 // Shutdowns the factory. | 34 // Shutdowns the factory. |
| 36 static void Shutdown(); | 35 static void Shutdown(); |
| 37 | 36 |
| 38 virtual ~ActivityFactory() {} | 37 virtual ~ActivityFactory() {} |
| 39 | 38 |
| 40 // Create an activity of a web page. If |title| is empty, the title will be | 39 // Create an activity of a web page. If |title| is empty, the title will be |
| 41 // obtained from the web contents. | 40 // obtained from the web contents. |
| 42 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, | 41 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, |
| 43 const base::string16& title, | 42 const base::string16& title, |
| 44 const GURL& url) = 0; | 43 const GURL& url) = 0; |
| 45 | 44 |
| 46 // Create an activity of an app with |app_window| for app shell environemnt. | |
| 47 // The returned activity should own |app_window|. | |
| 48 // TODO(oshima): Consolidate these two methods to create AppActivity | |
| 49 // once crbug.com/403726 is finished. | |
| 50 virtual Activity* CreateAppActivity(extensions::ShellAppWindow* app_window, | |
| 51 const std::string& id) = 0; | |
| 52 | |
| 53 // Create an activity of an app with |app_window| for chrome environment and | 45 // Create an activity of an app with |app_window| for chrome environment and |
| 54 // |web_view| that will host the content. | 46 // |web_view| that will host the content. |
| 55 virtual Activity* CreateAppActivity(extensions::AppWindow* app_window, | 47 virtual Activity* CreateAppActivity(extensions::AppWindow* app_window, |
| 56 views::WebView* web_view) = 0; | 48 views::WebView* web_view) = 0; |
| 57 }; | 49 }; |
| 58 | 50 |
| 59 } // namespace athena | 51 } // namespace athena |
| 60 | 52 |
| 61 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ | 53 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ |
| OLD | NEW |