Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / athena / activity / public / activity_manager.h
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_MANAGER_H_
6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_
7
8 #include <vector>
9
10 #include "athena/athena_export.h"
11
12 namespace aura {
13 class Window;
14 }
15
16 namespace athena {
17
18 class Activity;
19 class ActivityManagerObserver;
20
21 using ActivityList = std::vector<Activity*>;
22
23 // Manages a set of activities.
24 class ATHENA_EXPORT ActivityManager {
25  public:
26   static ActivityManager* Create();
27   static ActivityManager* Get();
28   static void Shutdown();
29
30   virtual ~ActivityManager() {}
31
32   // Adds/Removes an activity. ActivityManager owns the activities.
33   virtual void AddActivity(Activity* activity) = 0;
34   virtual void RemoveActivity(Activity* activity) = 0;
35
36   // Returns a list of activities, sorted in their activation order (the most
37   // recently used activity is at the front of the returned list).
38   virtual const ActivityList& GetActivityList() = 0;
39
40   // Returns the activity that has a |window| as toplevel window, or
41   // nullptr if such activity does not exist.
42   virtual Activity* GetActivityForWindow(aura::Window* window) = 0;
43
44   virtual void AddObserver(ActivityManagerObserver* observer) = 0;
45   virtual void RemoveObserver(ActivityManagerObserver* observer) = 0;
46 };
47
48 }  // namespace athena
49
50 #endif  // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_