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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 void AppActivityRegistry::DelayedUnload() { | 112 void AppActivityRegistry::DelayedUnload() { |
113 if (!ExtensionsDelegate::Get(browser_context_)->UnloadApp(app_id_)) { | 113 if (!ExtensionsDelegate::Get(browser_context_)->UnloadApp(app_id_)) { |
114 while(!activity_list_.empty()) | 114 while(!activity_list_.empty()) |
115 Activity::Delete(activity_list_.back()); | 115 Activity::Delete(activity_list_.back()); |
116 } | 116 } |
117 } | 117 } |
118 | 118 |
119 AppActivity* AppActivityRegistry::GetMruActivity() { | 119 AppActivity* AppActivityRegistry::GetMruActivity() { |
120 DCHECK(activity_list_.size()); | 120 DCHECK(activity_list_.size()); |
121 WindowListProvider* window_list_provider = | 121 WindowListProvider* window_list_provider = |
122 WindowManager::GetInstance()->GetWindowListProvider(); | 122 WindowManager::Get()->GetWindowListProvider(); |
123 const aura::Window::Windows& children = | 123 const aura::Window::Windows& children = |
124 window_list_provider->GetWindowList(); | 124 window_list_provider->GetWindowList(); |
125 // Find the first window in the container which is part of the application. | 125 // Find the first window in the container which is part of the application. |
126 for (aura::Window::Windows::const_iterator child_iterator = children.begin(); | 126 for (aura::Window::Windows::const_iterator child_iterator = children.begin(); |
127 child_iterator != children.end(); ++child_iterator) { | 127 child_iterator != children.end(); ++child_iterator) { |
128 for (std::vector<AppActivity*>::iterator app_iterator = | 128 for (std::vector<AppActivity*>::iterator app_iterator = |
129 activity_list_.begin(); | 129 activity_list_.begin(); |
130 app_iterator != activity_list_.end(); ++app_iterator) { | 130 app_iterator != activity_list_.end(); ++app_iterator) { |
131 if (*child_iterator == (*app_iterator)->GetWindow()) | 131 if (*child_iterator == (*app_iterator)->GetWindow()) |
132 return *app_iterator; | 132 return *app_iterator; |
133 } | 133 } |
134 } | 134 } |
135 NOTREACHED() << "The application does not get tracked by the mru list"; | 135 NOTREACHED() << "The application does not get tracked by the mru list"; |
136 return NULL; | 136 return NULL; |
137 } | 137 } |
138 | 138 |
139 } // namespace athena | 139 } // namespace athena |
OLD | NEW |