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

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

Issue 55143010: Fixing V2 application issues on M-32 for the M-31 legacy multi user mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comment Created 7 years, 1 month 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 | « chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h ('k') | 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/shell_window_launcher_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
index 6ebf06107cc58961c0315ea5f18771bb0de307fc..37944845e090a9f63063c8401f4b763a5058c821 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_controller.cc
@@ -15,6 +15,10 @@
#include "ui/aura/client/activation_client.h"
#include "ui/aura/root_window.h"
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/ui/ash/multi_user_window_manager.h"
+#endif
+
using apps::ShellWindow;
namespace {
@@ -35,9 +39,11 @@ bool ControlsWindow(aura::Window* window) {
ShellWindowLauncherController::ShellWindowLauncherController(
ChromeLauncherController* owner)
: owner_(owner),
- registry_(apps::ShellWindowRegistry::Get(owner->profile())),
activation_client_(NULL) {
- registry_->AddObserver(this);
+ apps::ShellWindowRegistry* registry =
+ apps::ShellWindowRegistry::Get(owner->profile());
+ registry_.insert(registry);
+ registry->AddObserver(this);
if (ash::Shell::HasInstance()) {
if (ash::Shell::GetInstance()->GetPrimaryRootWindow()) {
activation_client_ = aura::client::GetActivationClient(
@@ -49,7 +55,10 @@ ShellWindowLauncherController::ShellWindowLauncherController(
}
ShellWindowLauncherController::~ShellWindowLauncherController() {
- registry_->RemoveObserver(this);
+ for (std::set<apps::ShellWindowRegistry*>::iterator it = registry_.begin();
+ it != registry_.end(); ++it)
+ (*it)->RemoveObserver(this);
+
if (activation_client_)
activation_client_->RemoveObserver(this);
for (WindowToAppLauncherIdMap::iterator iter =
@@ -59,6 +68,24 @@ ShellWindowLauncherController::~ShellWindowLauncherController() {
}
}
+void ShellWindowLauncherController::AdditionalUserAddedToSession(
+ Profile* profile) {
+#if defined(OS_CHROMEOS)
+ // TODO(skuhne): This was added for the legacy side by side mode in M32. If
+ // this mode gets no longer pursued this special case can be removed.
+ if (chrome::MultiUserWindowManager::GetMultiProfileMode() !=
+ chrome::MultiUserWindowManager::MULTI_PROFILE_MODE_MIXED)
+ return;
+
+ apps::ShellWindowRegistry* registry = apps::ShellWindowRegistry::Get(profile);
+ if (registry_.find(registry) != registry_.end())
+ return;
+
+ registry->AddObserver(this);
+ registry_.insert(registry);
+#endif
+}
+
void ShellWindowLauncherController::OnShellWindowAdded(
ShellWindow* shell_window) {
if (!ControlsWindow(shell_window->GetNativeWindow()))
« no previous file with comments | « chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698