|
6 | 6 |
|
7 | 7 | #include "chrome/browser/profiles/profile.h"
|
8 | 8 | #include "chrome/browser/profiles/profile_manager.h"
|
| 9 | +#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
9 | 10 | #include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
|
10 | 11 | #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
|
11 | 12 | #include "components/signin/core/account_id/account_id.h"
|
|
15 | 16 |
|
16 | 17 | MultiProfileAppWindowLauncherController::
|
17 | 18 | MultiProfileAppWindowLauncherController(ChromeLauncherController* owner)
|
18 |
| - : ExtensionAppWindowLauncherController(owner) {} |
| 19 | + : ExtensionAppWindowLauncherController(owner) { |
| 20 | + // We might have already active windows. |
| 21 | + extensions::AppWindowRegistry* registry = |
| 22 | + extensions::AppWindowRegistry::Get(owner->profile()); |
| 23 | + app_window_list_.insert(app_window_list_.end(), |
| 24 | + registry->app_windows().begin(), |
| 25 | + registry->app_windows().end()); |
| 26 | +} |
19 | 27 |
|
20 | 28 | MultiProfileAppWindowLauncherController::
|
21 | 29 | ~MultiProfileAppWindowLauncherController() {
|
@@ -61,6 +69,7 @@ void MultiProfileAppWindowLauncherController::AdditionalUserAddedToSession(
|
61 | 69 | // Each users AppWindowRegistry needs to be observed.
|
62 | 70 | extensions::AppWindowRegistry* registry =
|
63 | 71 | extensions::AppWindowRegistry::Get(profile);
|
| 72 | + DCHECK(registry->app_windows().empty()); |
64 | 73 | multi_user_registry_.push_back(registry);
|
65 | 74 | registry->AddObserver(this);
|
66 | 75 | }
|
|
0 commit comments