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/content/app_activity_registry.h" | 5 #include "athena/content/app_activity_registry.h" |
6 | 6 |
7 #include "athena/activity/public/activity_manager.h" | 7 #include "athena/activity/public/activity_manager.h" |
8 #include "athena/content/app_activity.h" | 8 #include "athena/content/app_activity.h" |
9 #include "athena/content/app_activity_proxy.h" | 9 #include "athena/content/app_activity_proxy.h" |
10 #include "athena/content/public/app_registry.h" | 10 #include "athena/content/public/app_registry.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 it != activity_list_.end(); ++it) { | 76 it != activity_list_.end(); ++it) { |
77 if ((*it)->GetCurrentState() != Activity::ACTIVITY_UNLOADED) | 77 if ((*it)->GetCurrentState() != Activity::ACTIVITY_UNLOADED) |
78 return; | 78 return; |
79 } | 79 } |
80 | 80 |
81 // Create an activity proxy which can be used to re-activate the app. Insert | 81 // Create an activity proxy which can be used to re-activate the app. Insert |
82 // the proxy then into the activity stream at the location of the (newest) | 82 // the proxy then into the activity stream at the location of the (newest) |
83 // current activity. | 83 // current activity. |
84 unloaded_activity_proxy_ = new AppActivityProxy(GetMruActivity(), this); | 84 unloaded_activity_proxy_ = new AppActivityProxy(GetMruActivity(), this); |
85 ActivityManager::Get()->AddActivity(unloaded_activity_proxy_); | 85 ActivityManager::Get()->AddActivity(unloaded_activity_proxy_); |
| 86 unloaded_activity_proxy_->GetWindow()->SetName("AppActivityProxy"); |
86 | 87 |
87 // This function can be called through an observer call. When that happens, | 88 // This function can be called through an observer call. When that happens, |
88 // several activities will be closed / started. That can then cause a crash. | 89 // several activities will be closed / started. That can then cause a crash. |
89 // We postpone therefore the activity destruction till after the observer is | 90 // We postpone therefore the activity destruction till after the observer is |
90 // done. | 91 // done. |
91 base::ThreadTaskRunnerHandle::Get()->PostTask( | 92 base::ThreadTaskRunnerHandle::Get()->PostTask( |
92 FROM_HERE, | 93 FROM_HERE, |
93 base::Bind(&AppActivityRegistry::DelayedUnload, base::Unretained(this))); | 94 base::Bind(&AppActivityRegistry::DelayedUnload, base::Unretained(this))); |
94 } | 95 } |
95 | 96 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 app_iterator != activity_list_.end(); ++app_iterator) { | 132 app_iterator != activity_list_.end(); ++app_iterator) { |
132 if (*child_iterator == (*app_iterator)->GetWindow()) | 133 if (*child_iterator == (*app_iterator)->GetWindow()) |
133 return *app_iterator; | 134 return *app_iterator; |
134 } | 135 } |
135 } | 136 } |
136 NOTREACHED() << "The application does not get tracked by the mru list"; | 137 NOTREACHED() << "The application does not get tracked by the mru list"; |
137 return nullptr; | 138 return nullptr; |
138 } | 139 } |
139 | 140 |
140 } // namespace athena | 141 } // namespace athena |
OLD | NEW |