| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/session_state_delegate_chromeos.h" | 5 #include "chrome/browser/ui/ash/session_state_delegate_chromeos.h" |
| 6 | 6 |
| 7 #include "ash/aura/wm_window_aura.h" | |
| 8 #include "ash/common/session/session_state_observer.h" | 7 #include "ash/common/session/session_state_observer.h" |
| 8 #include "ash/common/wm_window.h" |
| 9 #include "ash/content/shell_content_state.h" | 9 #include "ash/content/shell_content_state.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 14 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 15 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 15 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 16 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 16 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 17 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 17 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 | 120 |
| 121 const user_manager::UserInfo* SessionStateDelegateChromeos::GetUserInfo( | 121 const user_manager::UserInfo* SessionStateDelegateChromeos::GetUserInfo( |
| 122 ash::UserIndex index) const { | 122 ash::UserIndex index) const { |
| 123 DCHECK_LT(index, NumberOfLoggedInUsers()); | 123 DCHECK_LT(index, NumberOfLoggedInUsers()); |
| 124 return user_manager::UserManager::Get()->GetLRULoggedInUsers()[index]; | 124 return user_manager::UserManager::Get()->GetLRULoggedInUsers()[index]; |
| 125 } | 125 } |
| 126 | 126 |
| 127 bool SessionStateDelegateChromeos::ShouldShowAvatar( | 127 bool SessionStateDelegateChromeos::ShouldShowAvatar( |
| 128 ash::WmWindow* window) const { | 128 ash::WmWindow* window) const { |
| 129 return chrome::MultiUserWindowManager::GetInstance()->ShouldShowAvatar( | 129 return chrome::MultiUserWindowManager::GetInstance()->ShouldShowAvatar( |
| 130 ash::WmWindowAura::GetAuraWindow(window)); | 130 ash::WmWindow::GetAuraWindow(window)); |
| 131 } | 131 } |
| 132 | 132 |
| 133 gfx::ImageSkia SessionStateDelegateChromeos::GetAvatarImageForWindow( | 133 gfx::ImageSkia SessionStateDelegateChromeos::GetAvatarImageForWindow( |
| 134 ash::WmWindow* window) const { | 134 ash::WmWindow* window) const { |
| 135 content::BrowserContext* context = | 135 content::BrowserContext* context = |
| 136 ash::ShellContentState::GetInstance()->GetBrowserContextForWindow( | 136 ash::ShellContentState::GetInstance()->GetBrowserContextForWindow( |
| 137 ash::WmWindowAura::GetAuraWindow(window)); | 137 ash::WmWindow::GetAuraWindow(window)); |
| 138 return GetAvatarImageForContext(context); | 138 return GetAvatarImageForContext(context); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void SessionStateDelegateChromeos::SwitchActiveUser( | 141 void SessionStateDelegateChromeos::SwitchActiveUser( |
| 142 const AccountId& account_id) { | 142 const AccountId& account_id) { |
| 143 SessionControllerClient::DoSwitchActiveUser(account_id); | 143 SessionControllerClient::DoSwitchActiveUser(account_id); |
| 144 } | 144 } |
| 145 | 145 |
| 146 void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) { | 146 void SessionStateDelegateChromeos::CycleActiveUser(CycleUser cycle_user) { |
| 147 SessionControllerClient::DoCycleActiveUser(cycle_user == CYCLE_TO_NEXT_USER); | 147 SessionControllerClient::DoCycleActiveUser(cycle_user == CYCLE_TO_NEXT_USER); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 return; | 197 return; |
| 198 | 198 |
| 199 session_state_ = new_state; | 199 session_state_ = new_state; |
| 200 NotifySessionStateChanged(); | 200 NotifySessionStateChanged(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void SessionStateDelegateChromeos::NotifySessionStateChanged() { | 203 void SessionStateDelegateChromeos::NotifySessionStateChanged() { |
| 204 for (ash::SessionStateObserver& observer : session_state_observer_list_) | 204 for (ash::SessionStateObserver& observer : session_state_observer_list_) |
| 205 observer.SessionStateChanged(session_state_); | 205 observer.SessionStateChanged(session_state_); |
| 206 } | 206 } |
| OLD | NEW |