| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_stub.h" | 8 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager_stub.h" |
| 9 | 9 |
| 10 #if defined(OS_CHROMEOS) | 10 #if defined(OS_CHROMEOS) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 multi_user_mode_ = MULTI_PROFILE_MODE_OFF; | 40 multi_user_mode_ = MULTI_PROFILE_MODE_OFF; |
| 41 #if defined(OS_CHROMEOS) | 41 #if defined(OS_CHROMEOS) |
| 42 ash::MultiProfileUMA::SessionMode mode = | 42 ash::MultiProfileUMA::SessionMode mode = |
| 43 ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; | 43 ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; |
| 44 if (!g_instance && | 44 if (!g_instance && |
| 45 ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { | 45 ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { |
| 46 MultiUserWindowManagerChromeOS* manager = | 46 MultiUserWindowManagerChromeOS* manager = |
| 47 new MultiUserWindowManagerChromeOS(ash::Shell::GetInstance() | 47 new MultiUserWindowManagerChromeOS(ash::Shell::GetInstance() |
| 48 ->session_state_delegate() | 48 ->session_state_delegate() |
| 49 ->GetUserInfo(0) | 49 ->GetUserInfo(0) |
| 50 ->GetAccountId() | 50 ->GetAccountId()); |
| 51 .GetUserEmail()); | |
| 52 g_instance = manager; | 51 g_instance = manager; |
| 53 manager->Init(); | 52 manager->Init(); |
| 54 multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; | 53 multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; |
| 55 mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; | 54 mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; |
| 56 } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { | 55 } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { |
| 57 // The side by side mode is using the Single user window manager since all | 56 // The side by side mode is using the Single user window manager since all |
| 58 // windows are unmanaged side by side. | 57 // windows are unmanaged side by side. |
| 59 multi_user_mode_ = MULTI_PROFILE_MODE_MIXED; | 58 multi_user_mode_ = MULTI_PROFILE_MODE_MIXED; |
| 60 mode = ash::MultiProfileUMA::SESSION_SIDE_BY_SIDE_MODE; | 59 mode = ash::MultiProfileUMA::SESSION_SIDE_BY_SIDE_MODE; |
| 61 } | 60 } |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 void MultiUserWindowManager::SetInstanceForTest( | 97 void MultiUserWindowManager::SetInstanceForTest( |
| 99 MultiUserWindowManager* instance, | 98 MultiUserWindowManager* instance, |
| 100 MultiProfileMode mode) { | 99 MultiProfileMode mode) { |
| 101 if (g_instance) | 100 if (g_instance) |
| 102 DeleteInstance(); | 101 DeleteInstance(); |
| 103 g_instance = instance; | 102 g_instance = instance; |
| 104 multi_user_mode_ = mode; | 103 multi_user_mode_ = mode; |
| 105 } | 104 } |
| 106 | 105 |
| 107 } // namespace chrome | 106 } // namespace chrome |
| OLD | NEW |