| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 if (activity_list_.empty()) { | 103 if (activity_list_.empty()) { |
| 104 AppRegistry::Get()->RemoveAppActivityRegistry(this); | 104 AppRegistry::Get()->RemoveAppActivityRegistry(this); |
| 105 // |This| is gone now. | 105 // |This| is gone now. |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void AppActivityRegistry::RestartApplication(AppActivityProxy* proxy) { | 109 void AppActivityRegistry::RestartApplication(AppActivityProxy* proxy) { |
| 110 DCHECK_EQ(unloaded_activity_proxy_, proxy); | 110 DCHECK_EQ(unloaded_activity_proxy_, proxy); |
| 111 // Restart the application. | 111 // Restart the application. |
| 112 ExtensionsDelegate::Get(browser_context_)->LaunchApp(app_id_); | 112 ExtensionsDelegate::Get(browser_context_)->LaunchApp(app_id_); |
| 113 // Remove the activity from the Activity manager. | 113 // Delete the activity which will also remove the it from the ActivityManager. |
| 114 ActivityManager::Get()->RemoveActivity(unloaded_activity_proxy_); | |
| 115 delete unloaded_activity_proxy_; // Will call ProxyDestroyed. | 114 delete unloaded_activity_proxy_; // Will call ProxyDestroyed. |
| 116 // After this call |this| might be gone if the app did not open a window yet. | 115 // After this call |this| might be gone if the app did not open a window yet. |
| 117 } | 116 } |
| 118 | 117 |
| 119 void AppActivityRegistry::MoveBeforeMruApplicationWindow(aura::Window* window) { | 118 void AppActivityRegistry::MoveBeforeMruApplicationWindow(aura::Window* window) { |
| 120 DCHECK(activity_list_.size()); | 119 DCHECK(activity_list_.size()); |
| 121 // TODO(skuhne): This needs to be changed to some kind of delegate which | 120 // TODO(skuhne): This needs to be changed to some kind of delegate which |
| 122 // resides in the window manager. | 121 // resides in the window manager. |
| 123 const aura::Window::Windows children = | 122 const aura::Window::Windows children = |
| 124 activity_list_[0]->GetWindow()->parent()->children();; | 123 activity_list_[0]->GetWindow()->parent()->children();; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 135 window->parent()->StackChildBelow(window, *child_iterator); | 134 window->parent()->StackChildBelow(window, *child_iterator); |
| 136 window->parent()->StackChildBelow(*child_iterator, window); | 135 window->parent()->StackChildBelow(*child_iterator, window); |
| 137 return; | 136 return; |
| 138 } | 137 } |
| 139 } | 138 } |
| 140 } | 139 } |
| 141 NOTREACHED() << "The application does not get tracked by the mru list"; | 140 NOTREACHED() << "The application does not get tracked by the mru list"; |
| 142 } | 141 } |
| 143 | 142 |
| 144 } // namespace athena | 143 } // namespace athena |
| OLD | NEW |