| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 5 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 6 | 6 |
| 7 #include "ash/common/ash_switches.h" | 7 #include "ash/common/ash_switches.h" |
| 8 #include "ash/common/session/session_state_delegate.h" | 8 #include "ash/common/session/session_state_delegate.h" |
| 9 #include "ash/common/wm_shell.h" |
| 9 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
| 10 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 11 #include "ash/shell_delegate.h" | 12 #include "ash/shell_delegate.h" |
| 12 #include "base/logging.h" | 13 #include "base/logging.h" |
| 13 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 14 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" | 15 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_chromeos.h" |
| 15 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_stub.h" | 16 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_stub.h" |
| 16 #include "components/signin/core/account_id/account_id.h" | 17 #include "components/signin/core/account_id/account_id.h" |
| 17 #include "components/user_manager/user_info.h" | 18 #include "components/user_manager/user_info.h" |
| 18 | 19 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 34 } | 35 } |
| 35 | 36 |
| 36 MultiUserWindowManager* MultiUserWindowManager::CreateInstance() { | 37 MultiUserWindowManager* MultiUserWindowManager::CreateInstance() { |
| 37 DCHECK(!g_instance); | 38 DCHECK(!g_instance); |
| 38 multi_user_mode_ = MULTI_PROFILE_MODE_OFF; | 39 multi_user_mode_ = MULTI_PROFILE_MODE_OFF; |
| 39 ash::MultiProfileUMA::SessionMode mode = | 40 ash::MultiProfileUMA::SessionMode mode = |
| 40 ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; | 41 ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; |
| 41 if (!g_instance && | 42 if (!g_instance && |
| 42 ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { | 43 ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { |
| 43 MultiUserWindowManagerChromeOS* manager = | 44 MultiUserWindowManagerChromeOS* manager = |
| 44 new MultiUserWindowManagerChromeOS(ash::Shell::GetInstance() | 45 new MultiUserWindowManagerChromeOS(ash::WmShell::Get() |
| 45 ->session_state_delegate() | 46 ->GetSessionStateDelegate() |
| 46 ->GetUserInfo(0) | 47 ->GetUserInfo(0) |
| 47 ->GetAccountId()); | 48 ->GetAccountId()); |
| 48 g_instance = manager; | 49 g_instance = manager; |
| 49 manager->Init(); | 50 manager->Init(); |
| 50 multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; | 51 multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; |
| 51 mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; | 52 mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; |
| 52 } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { | 53 } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { |
| 53 // The side by side mode is using the Single user window manager since all | 54 // The side by side mode is using the Single user window manager since all |
| 54 // windows are unmanaged side by side. | 55 // windows are unmanaged side by side. |
| 55 multi_user_mode_ = MULTI_PROFILE_MODE_MIXED; | 56 multi_user_mode_ = MULTI_PROFILE_MODE_MIXED; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void MultiUserWindowManager::SetInstanceForTest( | 95 void MultiUserWindowManager::SetInstanceForTest( |
| 95 MultiUserWindowManager* instance, | 96 MultiUserWindowManager* instance, |
| 96 MultiProfileMode mode) { | 97 MultiProfileMode mode) { |
| 97 if (g_instance) | 98 if (g_instance) |
| 98 DeleteInstance(); | 99 DeleteInstance(); |
| 99 g_instance = instance; | 100 g_instance = instance; |
| 100 multi_user_mode_ = mode; | 101 multi_user_mode_ = mode; |
| 101 } | 102 } |
| 102 | 103 |
| 103 } // namespace chrome | 104 } // namespace chrome |
| OLD | NEW |