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