| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include "ash/content_support/gpu_support_impl.h" | 7 #include "ash/content_support/gpu_support_impl.h" |
| 8 #include "ash/magnifier/magnifier_constants.h" | 8 #include "ash/magnifier/magnifier_constants.h" |
| 9 #include "ash/wm/window_state.h" | 9 #include "ash/wm/window_state.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 bool ChromeShellDelegate::IsMultiProfilesEnabled() const { | 45 bool ChromeShellDelegate::IsMultiProfilesEnabled() const { |
| 46 if (!profiles::IsMultipleProfilesEnabled()) | 46 if (!profiles::IsMultipleProfilesEnabled()) |
| 47 return false; | 47 return false; |
| 48 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 49 // If there is a user manager, we need to see that we can at least have 2 | 49 // If there is a user manager, we need to see that we can at least have 2 |
| 50 // simultaneous users to allow this feature. | 50 // simultaneous users to allow this feature. |
| 51 if (!user_manager::UserManager::IsInitialized()) | 51 if (!user_manager::UserManager::IsInitialized()) |
| 52 return false; | 52 return false; |
| 53 size_t admitted_users_to_be_added = user_manager::UserManager::Get() | 53 size_t admitted_users_to_be_added = |
| 54 ->GetUsersAdmittedForMultiProfile() | 54 user_manager::UserManager::Get()->GetUsersAllowedForMultiProfile().size(); |
| 55 .size(); | |
| 56 size_t logged_in_users = | 55 size_t logged_in_users = |
| 57 user_manager::UserManager::Get()->GetLoggedInUsers().size(); | 56 user_manager::UserManager::Get()->GetLoggedInUsers().size(); |
| 58 if (!logged_in_users) { | 57 if (!logged_in_users) { |
| 59 // The shelf gets created on the login screen and as such we have to create | 58 // The shelf gets created on the login screen and as such we have to create |
| 60 // all multi profile items of the the system tray menu before the user logs | 59 // all multi profile items of the the system tray menu before the user logs |
| 61 // in. For special cases like Kiosk mode and / or guest mode this isn't a | 60 // in. For special cases like Kiosk mode and / or guest mode this isn't a |
| 62 // problem since either the browser gets restarted and / or the flag is not | 61 // problem since either the browser gets restarted and / or the flag is not |
| 63 // allowed, but for an "ephermal" user (see crbug.com/312324) it is not | 62 // allowed, but for an "ephermal" user (see crbug.com/312324) it is not |
| 64 // decided yet if he could add other users to his session or not. | 63 // decided yet if he could add other users to his session or not. |
| 65 // TODO(skuhne): As soon as the issue above needs to be resolved, this logic | 64 // TODO(skuhne): As soon as the issue above needs to be resolved, this logic |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 152 |
| 154 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( | 153 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( |
| 155 ash::VirtualKeyboardStateObserver* observer) { | 154 ash::VirtualKeyboardStateObserver* observer) { |
| 156 keyboard_state_observer_list_.AddObserver(observer); | 155 keyboard_state_observer_list_.AddObserver(observer); |
| 157 } | 156 } |
| 158 | 157 |
| 159 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( | 158 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( |
| 160 ash::VirtualKeyboardStateObserver* observer) { | 159 ash::VirtualKeyboardStateObserver* observer) { |
| 161 keyboard_state_observer_list_.RemoveObserver(observer); | 160 keyboard_state_observer_list_.RemoveObserver(observer); |
| 162 } | 161 } |
| OLD | NEW |