Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: athena/activity/public/activity_manager.h

Issue 694353004: athena: Expose the list of activities from the ActivityManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_ 5 #ifndef ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_
6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_ 6 #define ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_
7 7
8 #include <vector>
9
8 #include "athena/athena_export.h" 10 #include "athena/athena_export.h"
9 11
10 namespace aura { 12 namespace aura {
11 class Window; 13 class Window;
12 } 14 }
13 15
14 namespace athena { 16 namespace athena {
15 17
16 class Activity; 18 class Activity;
17 class ActivityManagerObserver; 19 class ActivityManagerObserver;
18 20
21 using ActivityList = std::vector<Activity*>;
22
19 // Manages a set of activities. 23 // Manages a set of activities.
20 class ATHENA_EXPORT ActivityManager { 24 class ATHENA_EXPORT ActivityManager {
21 public: 25 public:
22 static ActivityManager* Create(); 26 static ActivityManager* Create();
23 static ActivityManager* Get(); 27 static ActivityManager* Get();
24 static void Shutdown(); 28 static void Shutdown();
25 29
26 virtual ~ActivityManager() {} 30 virtual ~ActivityManager() {}
27 31
28 // Adds/Removes an activity. ActivityManager owns the activities. 32 // Adds/Removes an activity. ActivityManager owns the activities.
29 virtual void AddActivity(Activity* activity) = 0; 33 virtual void AddActivity(Activity* activity) = 0;
30 virtual void RemoveActivity(Activity* activity) = 0; 34 virtual void RemoveActivity(Activity* activity) = 0;
31 35
36 // Updates the UI when the task color/title changes.
37 virtual void UpdateActivity(Activity* activity) = 0;
38
39 // Returns a list of activities, sorted in their activation order (the most
40 // recently used activity is at the front of the returned list).
41 virtual const ActivityList& GetActivityList() = 0;
42
32 // Returns the activity that has a |window| as toplevel window, or 43 // Returns the activity that has a |window| as toplevel window, or
33 // nullptr if such activity does not exist. 44 // nullptr if such activity does not exist.
34 virtual Activity* GetActivityForWindow(aura::Window* window) = 0; 45 virtual Activity* GetActivityForWindow(aura::Window* window) = 0;
35 46
36 // Updates the UI when the task color/title changes.
37 virtual void UpdateActivity(Activity* activity) = 0;
38
39 virtual void AddObserver(ActivityManagerObserver* observer) = 0; 47 virtual void AddObserver(ActivityManagerObserver* observer) = 0;
40 virtual void RemoveObserver(ActivityManagerObserver* observer) = 0; 48 virtual void RemoveObserver(ActivityManagerObserver* observer) = 0;
41 }; 49 };
42 50
43 } // namespace athena 51 } // namespace athena
44 52
45 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_ 53 #endif // ATHENA_ACTIVITY_PUBLIC_ACTIVITY_MANAGER_H_
OLDNEW
« no previous file with comments | « athena/activity/activity_manager_unittest.cc ('k') | athena/activity/public/activity_manager_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698