OLD | NEW |
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 #include "athena/activity/public/activity_manager.h" | 5 #include "athena/activity/public/activity_manager.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
11 #include "ui/views/widget/widget_observer.h" | 11 #include "ui/views/widget/widget_observer.h" |
12 | 12 |
13 namespace athena { | 13 namespace athena { |
14 | 14 |
15 class ActivityManagerObserver; | 15 class ActivityManagerObserver; |
16 | 16 |
17 class ActivityManagerImpl : public ActivityManager, | 17 class ActivityManagerImpl : public ActivityManager, |
18 public views::WidgetObserver { | 18 public views::WidgetObserver { |
19 public: | 19 public: |
20 ActivityManagerImpl(); | 20 ActivityManagerImpl(); |
21 virtual ~ActivityManagerImpl(); | 21 virtual ~ActivityManagerImpl(); |
22 | 22 |
23 int num_activities() const { return activities_.size(); } | 23 int num_activities() const { return activities_.size(); } |
24 | 24 |
25 // ActivityManager: | 25 // ActivityManager: |
26 virtual void AddActivity(Activity* activity) OVERRIDE; | 26 virtual void AddActivity(Activity* activity) override; |
27 virtual void RemoveActivity(Activity* activity) OVERRIDE; | 27 virtual void RemoveActivity(Activity* activity) override; |
28 virtual void UpdateActivity(Activity* activity) OVERRIDE; | 28 virtual void UpdateActivity(Activity* activity) override; |
29 virtual Activity* GetActivityForWindow(aura::Window* window) OVERRIDE; | 29 virtual Activity* GetActivityForWindow(aura::Window* window) override; |
30 virtual void AddObserver(ActivityManagerObserver* observer) OVERRIDE; | 30 virtual void AddObserver(ActivityManagerObserver* observer) override; |
31 virtual void RemoveObserver(ActivityManagerObserver* observer) OVERRIDE; | 31 virtual void RemoveObserver(ActivityManagerObserver* observer) override; |
32 | 32 |
33 // views::WidgetObserver | 33 // views::WidgetObserver |
34 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 34 virtual void OnWidgetDestroying(views::Widget* widget) override; |
35 | 35 |
36 private: | 36 private: |
37 std::vector<Activity*> activities_; | 37 std::vector<Activity*> activities_; |
38 | 38 |
39 ObserverList<ActivityManagerObserver> observers_; | 39 ObserverList<ActivityManagerObserver> observers_; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(ActivityManagerImpl); | 41 DISALLOW_COPY_AND_ASSIGN(ActivityManagerImpl); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace athena | 44 } // namespace athena |
OLD | NEW |