| 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/activity_manager_impl.h" | 5 #include "athena/activity/activity_manager_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "athena/activity/activity_widget_delegate.h" | 9 #include "athena/activity/activity_widget_delegate.h" |
| 10 #include "athena/activity/public/activity.h" | 10 #include "athena/activity/public/activity.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (find != activities_.end()) { | 84 if (find != activities_.end()) { |
| 85 FOR_EACH_OBSERVER( | 85 FOR_EACH_OBSERVER( |
| 86 ActivityManagerObserver, observers_, OnActivityEnding(activity)); | 86 ActivityManagerObserver, observers_, OnActivityEnding(activity)); |
| 87 activities_.erase(find); | 87 activities_.erase(find); |
| 88 views::Widget* widget = GetWidget(activity); | 88 views::Widget* widget = GetWidget(activity); |
| 89 widget->GetNativeView()->RemoveObserver(this); | 89 widget->GetNativeView()->RemoveObserver(this); |
| 90 widget->Close(); | 90 widget->Close(); |
| 91 } | 91 } |
| 92 } | 92 } |
| 93 | 93 |
| 94 void ActivityManagerImpl::UpdateActivity(Activity* activity) { | |
| 95 views::Widget* widget = GetWidget(activity); | |
| 96 widget->UpdateWindowIcon(); | |
| 97 widget->UpdateWindowTitle(); | |
| 98 } | |
| 99 | |
| 100 const ActivityList& ActivityManagerImpl::GetActivityList() { | 94 const ActivityList& ActivityManagerImpl::GetActivityList() { |
| 101 return activities_; | 95 return activities_; |
| 102 } | 96 } |
| 103 | 97 |
| 104 Activity* ActivityManagerImpl::GetActivityForWindow(aura::Window* window) { | 98 Activity* ActivityManagerImpl::GetActivityForWindow(aura::Window* window) { |
| 105 struct Matcher { | 99 struct Matcher { |
| 106 Matcher(aura::Window* w) : window(w) {} | 100 Matcher(aura::Window* w) : window(w) {} |
| 107 bool operator()(Activity* activity) { | 101 bool operator()(Activity* activity) { |
| 108 return activity->GetWindow() == window; | 102 return activity->GetWindow() == window; |
| 109 } | 103 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 return instance; | 154 return instance; |
| 161 } | 155 } |
| 162 | 156 |
| 163 void ActivityManager::Shutdown() { | 157 void ActivityManager::Shutdown() { |
| 164 CHECK(instance); | 158 CHECK(instance); |
| 165 delete instance; | 159 delete instance; |
| 166 } | 160 } |
| 167 | 161 |
| 168 | 162 |
| 169 } // namespace athena | 163 } // namespace athena |
| OLD | NEW |