Roll leveldb 3f7758:803d69 (v1.17 -> v1.18)
[chromium-blink-merge.git] / athena / activity / public / activity_factory.h
blob2680e5325fc4f496804bab777ab3281e50b41115
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.
5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_
6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_
8 #include <string>
10 #include "athena/athena_export.h"
11 #include "url/gurl.h"
13 namespace content {
14 class BrowserContext;
15 class WebContents;
18 namespace views {
19 class WebView;
22 namespace athena {
23 class Activity;
25 class ATHENA_EXPORT ActivityFactory {
26 public:
27 // Registers the singleton factory.
28 static void RegisterActivityFactory(ActivityFactory* factory);
30 // Gets the registered singleton factory.
31 static ActivityFactory* Get();
33 // Shutdowns the factory.
34 static void Shutdown();
36 virtual ~ActivityFactory() {}
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;
44 // Create an activity with |contents|. The title is obtained from the web
45 // contents.
46 virtual Activity* CreateWebActivity(content::WebContents* contents) = 0;
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;
54 } // namespace athena
56 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_