summaryrefslogtreecommitdiffstats
path: root/athena/activity/public/activity_factory.h
blob: 91f1ec79bcfac04aeff112ab1652bbf4186a0d06 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_
#define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_

#include "athena/athena_export.h"
#include "url/gurl.h"

namespace content {
class BrowserContext;
}

namespace extensions {
class AppWindow;
class ShellAppWindow;
}

namespace athena {
class Activity;

class ATHENA_EXPORT ActivityFactory {
 public:
  // Registers the singleton factory.
  static void RegisterActivityFactory(ActivityFactory* factory);

  // Gets the registered singleton factory.
  static ActivityFactory* Get();

  // Shutdowns the factory.
  static void Shutdown();

  virtual ~ActivityFactory() {}

  // Create an activity of a web page.
  virtual Activity* CreateWebActivity(content::BrowserContext* browser_context,
                                      const GURL& url) = 0;

  // Create an activity of an app with |app_window| for app shell environemnt.
  // The returned activity should own |app_window|.
  // TODO(oshima): Consolidate these two methods to create AppActivity
  // once crbug.com/403726 is finished.
  virtual Activity* CreateAppActivity(extensions::ShellAppWindow* app_window,
                                      const std::string& id) = 0;

  // Create an activity of an app with |app_window| for chrome environment.
  virtual Activity* CreateAppActivity(extensions::AppWindow* app_window) = 0;
};

}  // namespace athena

#endif  // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_FACTORY_H_