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

Unified Diff: chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc

Issue 2118593002: mash: Migrate ShellDelegate ownership and access to WmShell. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 4 years, 5 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
Index: chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
diff --git a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
index ea34fc03f23e028169e622b53f4c3cf99f5c1a76..e0d9fbe40fa66c20e5a8e5c6af9d3f9b5d992861 100644
--- a/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
+++ b/chrome/browser/ui/ash/multi_user/multi_user_window_manager.cc
@@ -6,10 +6,9 @@
#include "ash/common/ash_switches.h"
#include "ash/common/session/session_state_delegate.h"
+#include "ash/common/shell_delegate.h"
#include "ash/common/wm_shell.h"
#include "ash/multi_profile_uma.h"
-#include "ash/shell.h"
-#include "ash/shell_delegate.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h"
@@ -39,22 +38,23 @@ MultiUserWindowManager* MultiUserWindowManager::CreateInstance() {
multi_user_mode_ = MULTI_PROFILE_MODE_OFF;
ash::MultiProfileUMA::SessionMode mode =
ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE;
- if (!g_instance &&
- ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) {
- MultiUserWindowManagerChromeOS* manager =
- new MultiUserWindowManagerChromeOS(ash::WmShell::Get()
- ->GetSessionStateDelegate()
- ->GetUserInfo(0)
- ->GetAccountId());
- g_instance = manager;
- manager->Init();
- multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED;
- mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE;
- } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) {
- // The side by side mode is using the Single user window manager since all
- // windows are unmanaged side by side.
- multi_user_mode_ = MULTI_PROFILE_MODE_MIXED;
- mode = ash::MultiProfileUMA::SESSION_SIDE_BY_SIDE_MODE;
+ if (ash::WmShell::Get()->delegate()->IsMultiProfilesEnabled()) {
+ if (!g_instance) {
+ MultiUserWindowManagerChromeOS* manager =
+ new MultiUserWindowManagerChromeOS(ash::WmShell::Get()
+ ->GetSessionStateDelegate()
+ ->GetUserInfo(0)
+ ->GetAccountId());
+ g_instance = manager;
+ manager->Init();
+ multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED;
+ mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE;
+ } else {
+ // The side by side mode is using the Single user window manager since all
+ // windows are unmanaged side by side.
+ multi_user_mode_ = MULTI_PROFILE_MODE_MIXED;
+ mode = ash::MultiProfileUMA::SESSION_SIDE_BY_SIDE_MODE;
+ }
}
ash::MultiProfileUMA::RecordSessionMode(mode);

Powered by Google App Engine
This is Rietveld 408576698