Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.cc

Issue 2738773003: [Merge M58] Fix crash whem window created before shelf creation. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.cc
index 6d7f1cab3feb665ab388bab866915ff6b88f5a4a..f57876e6db8269859c6b8c9245bab50353bc075d 100644
--- a/chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/multi_profile_app_window_launcher_controller.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_util.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
#include "components/signin/core/account_id/account_id.h"
@@ -15,7 +16,14 @@
MultiProfileAppWindowLauncherController::
MultiProfileAppWindowLauncherController(ChromeLauncherController* owner)
- : ExtensionAppWindowLauncherController(owner) {}
+ : ExtensionAppWindowLauncherController(owner) {
+ // We might have already active windows.
+ extensions::AppWindowRegistry* registry =
+ extensions::AppWindowRegistry::Get(owner->profile());
+ app_window_list_.insert(app_window_list_.end(),
+ registry->app_windows().begin(),
+ registry->app_windows().end());
+}
MultiProfileAppWindowLauncherController::
~MultiProfileAppWindowLauncherController() {
@@ -61,6 +69,7 @@ void MultiProfileAppWindowLauncherController::AdditionalUserAddedToSession(
// Each users AppWindowRegistry needs to be observed.
extensions::AppWindowRegistry* registry =
extensions::AppWindowRegistry::Get(profile);
+ DCHECK(registry->app_windows().empty());
multi_user_registry_.push_back(registry);
registry->AddObserver(this);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698