| 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 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 MultiUserWindowManager* MultiUserWindowManager::CreateInstance() { | 37 MultiUserWindowManager* MultiUserWindowManager::CreateInstance() { |
| 38 DCHECK(!g_instance); | 38 DCHECK(!g_instance); |
| 39 multi_user_mode_ = MULTI_PROFILE_MODE_OFF; | 39 multi_user_mode_ = MULTI_PROFILE_MODE_OFF; |
| 40 #if defined(OS_CHROMEOS) | 40 #if defined(OS_CHROMEOS) |
| 41 ash::MultiProfileUMA::SessionMode mode = | 41 ash::MultiProfileUMA::SessionMode mode = |
| 42 ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; | 42 ash::MultiProfileUMA::SESSION_SINGLE_USER_MODE; |
| 43 if (!g_instance && | 43 if (!g_instance && |
| 44 ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { | 44 ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { |
| 45 g_instance = | 45 MultiUserWindowManagerChromeOS* manager = |
| 46 new MultiUserWindowManagerChromeOS(ash::Shell::GetInstance() | 46 new MultiUserWindowManagerChromeOS(ash::Shell::GetInstance() |
| 47 ->session_state_delegate() | 47 ->session_state_delegate() |
| 48 ->GetUserInfo(0) | 48 ->GetUserInfo(0) |
| 49 ->GetUserID()); | 49 ->GetUserID()); |
| 50 g_instance = manager; |
| 51 manager->Init(); |
| 50 multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; | 52 multi_user_mode_ = MULTI_PROFILE_MODE_SEPARATED; |
| 51 mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; | 53 mode = ash::MultiProfileUMA::SESSION_SEPARATE_DESKTOP_MODE; |
| 52 } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { | 54 } else if (ash::Shell::GetInstance()->delegate()->IsMultiProfilesEnabled()) { |
| 53 // The side by side mode is using the Single user window manager since all | 55 // The side by side mode is using the Single user window manager since all |
| 54 // windows are unmanaged side by side. | 56 // windows are unmanaged side by side. |
| 55 multi_user_mode_ = MULTI_PROFILE_MODE_MIXED; | 57 multi_user_mode_ = MULTI_PROFILE_MODE_MIXED; |
| 56 mode = ash::MultiProfileUMA::SESSION_SIDE_BY_SIDE_MODE; | 58 mode = ash::MultiProfileUMA::SESSION_SIDE_BY_SIDE_MODE; |
| 57 } | 59 } |
| 58 ash::MultiProfileUMA::RecordSessionMode(mode); | 60 ash::MultiProfileUMA::RecordSessionMode(mode); |
| 59 #endif | 61 #endif |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 void MultiUserWindowManager::SetInstanceForTest( | 96 void MultiUserWindowManager::SetInstanceForTest( |
| 95 MultiUserWindowManager* instance, | 97 MultiUserWindowManager* instance, |
| 96 MultiProfileMode mode) { | 98 MultiProfileMode mode) { |
| 97 if (g_instance) | 99 if (g_instance) |
| 98 DeleteInstance(); | 100 DeleteInstance(); |
| 99 g_instance = instance; | 101 g_instance = instance; |
| 100 multi_user_mode_ = mode; | 102 multi_user_mode_ = mode; |
| 101 } | 103 } |
| 102 | 104 |
| 103 } // namespace chrome | 105 } // namespace chrome |
| OLD | NEW |