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