| OLD | NEW |
| (Empty) |
| 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 <string> | |
| 9 | |
| 10 #include "athena/athena_export.h" | |
| 11 #include "url/gurl.h" | |
| 12 | |
| 13 namespace content { | |
| 14 class BrowserContext; | |
| 15 class WebContents; | |
| 16 } | |
| 17 | |
| 18 namespace views { | |
| 19 class WebView; | |
| 20 } | |
| 21 | |
| 22 namespace athena { | |
| 23 class Activity; | |
| 24 | |
| 25 class ATHENA_EXPORT ActivityFactory { | |
| 26 public: | |
| 27 // Registers the singleton factory. | |
| 28 static void RegisterActivityFactory(ActivityFactory* factory); | |
| 29 | |
| 30 // Gets the registered singleton factory. | |
| 31 static ActivityFactory* Get(); | |
| 32 | |
| 33 // Shutdowns the factory. | |
| 34 static void Shutdown(); | |
| 35 | |
| 36 virtual ~ActivityFactory() {} | |
| 37 | |
| 38 // Create an activity of a web page. If |title| is empty, the title will be | |
| 39 // obtained from the web contents. | |
| 40 virtual Activity* CreateWebActivity(content::BrowserContext* browser_context, | |
| 41 const base::string16& title, | |
| 42 const GURL& url) = 0; | |
| 43 | |
| 44 // Create an activity with |contents|. The title is obtained from the web | |
| 45 // contents. | |
| 46 virtual Activity* CreateWebActivity(content::WebContents* contents) = 0; | |
| 47 | |
| 48 // Create an activity of an app with |app_id| and | |
| 49 // |web_view| that will host the content. | |
| 50 virtual Activity* CreateAppActivity(const std::string& app_id, | |
| 51 views::WebView* web_view) = 0; | |
| 52 }; | |
| 53 | |
| 54 } // namespace athena | |
| 55 | |
| 56 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_ | |
| OLD | NEW |