OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/user_switch_animator_chromeos.h" | 5 #include "chrome/browser/ui/ash/multi_user/user_switch_animator_chromeos.h" |
6 | 6 |
7 #include "ash/desktop_background/user_wallpaper_delegate.h" | 7 #include "ash/desktop_background/user_wallpaper_delegate.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shelf/shelf_layout_manager.h" | 9 #include "ash/shelf/shelf_layout_manager.h" |
10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 if (itr != window_list->end()) { | 95 if (itr != window_list->end()) { |
96 window_list->erase(itr); | 96 window_list->erase(itr); |
97 window_list->push_back(active_window); | 97 window_list->push_back(active_window); |
98 } | 98 } |
99 } | 99 } |
100 | 100 |
101 } // namespace | 101 } // namespace |
102 | 102 |
103 UserSwitchAnimatorChromeOS::UserSwitchAnimatorChromeOS( | 103 UserSwitchAnimatorChromeOS::UserSwitchAnimatorChromeOS( |
104 MultiUserWindowManagerChromeOS* owner, | 104 MultiUserWindowManagerChromeOS* owner, |
105 const std::string& new_user_id, | 105 const user_manager::UserID& new_user_id, |
106 int animation_speed_ms) | 106 int animation_speed_ms) |
107 : owner_(owner), | 107 : owner_(owner), |
108 new_user_id_(new_user_id), | 108 new_user_id_(new_user_id), |
109 animation_speed_ms_(animation_speed_ms), | 109 animation_speed_ms_(animation_speed_ms), |
110 animation_step_(ANIMATION_STEP_HIDE_OLD_USER), | 110 animation_step_(ANIMATION_STEP_HIDE_OLD_USER), |
111 screen_cover_(GetScreenCover(NULL)), | 111 screen_cover_(GetScreenCover(NULL)), |
112 windows_by_user_id_() { | 112 windows_by_user_id_() { |
113 BuildUserToWindowsListMap(); | 113 BuildUserToWindowsListMap(); |
114 AdvanceUserTransitionAnimation(); | 114 AdvanceUserTransitionAnimation(); |
115 | 115 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 ash::Shell::GetInstance()->user_wallpaper_delegate(); | 187 ash::Shell::GetInstance()->user_wallpaper_delegate(); |
188 if (animation_step == ANIMATION_STEP_HIDE_OLD_USER) { | 188 if (animation_step == ANIMATION_STEP_HIDE_OLD_USER) { |
189 // Set the wallpaper cross dissolve animation duration to our complete | 189 // Set the wallpaper cross dissolve animation duration to our complete |
190 // animation cycle for a fade in and fade out. | 190 // animation cycle for a fade in and fade out. |
191 int duration = | 191 int duration = |
192 NO_USER_COVERS_SCREEN == screen_cover_ ? (2 * animation_speed_ms_) : 0; | 192 NO_USER_COVERS_SCREEN == screen_cover_ ? (2 * animation_speed_ms_) : 0; |
193 wallpaper_delegate->SetAnimationDurationOverride( | 193 wallpaper_delegate->SetAnimationDurationOverride( |
194 std::max(duration, kMinimalAnimationTimeMS)); | 194 std::max(duration, kMinimalAnimationTimeMS)); |
195 if (screen_cover_ != NEW_USER_COVERS_SCREEN) { | 195 if (screen_cover_ != NEW_USER_COVERS_SCREEN) { |
196 chromeos::WallpaperManager::Get()->SetUserWallpaperNow(new_user_id_); | 196 chromeos::WallpaperManager::Get()->SetUserWallpaperNow(new_user_id_); |
197 wallpaper_user_id_ = | 197 wallpaper_user_email_ = |
198 (NO_USER_COVERS_SCREEN == screen_cover_ ? "->" : "") + | 198 (NO_USER_COVERS_SCREEN == screen_cover_ ? "->" : "") + |
199 new_user_id_; | 199 new_user_id_.GetUserEmail(); |
200 } | 200 } |
201 } else if (animation_step == ANIMATION_STEP_FINALIZE) { | 201 } else if (animation_step == ANIMATION_STEP_FINALIZE) { |
202 // Revert the wallpaper cross dissolve animation duration back to the | 202 // Revert the wallpaper cross dissolve animation duration back to the |
203 // default. | 203 // default. |
204 if (screen_cover_ == NEW_USER_COVERS_SCREEN) | 204 if (screen_cover_ == NEW_USER_COVERS_SCREEN) |
205 chromeos::WallpaperManager::Get()->SetUserWallpaperNow(new_user_id_); | 205 chromeos::WallpaperManager::Get()->SetUserWallpaperNow(new_user_id_); |
206 | 206 |
207 // Coming here the wallpaper user id is the final result. No matter how we | 207 // Coming here the wallpaper user id is the final result. No matter how we |
208 // got here. | 208 // got here. |
209 wallpaper_user_id_ = new_user_id_; | 209 wallpaper_user_email_ = new_user_id_.GetUserEmail(); |
210 wallpaper_delegate->SetAnimationDurationOverride(0); | 210 wallpaper_delegate->SetAnimationDurationOverride(0); |
211 } | 211 } |
212 } | 212 } |
213 | 213 |
214 void UserSwitchAnimatorChromeOS::TransitionUserShelf( | 214 void UserSwitchAnimatorChromeOS::TransitionUserShelf( |
215 AnimationStep animation_step) { | 215 AnimationStep animation_step) { |
216 ChromeLauncherController* chrome_launcher_controller = | 216 ChromeLauncherController* chrome_launcher_controller = |
217 ChromeLauncherController::instance(); | 217 ChromeLauncherController::instance(); |
218 // The shelf animation duration override. | 218 // The shelf animation duration override. |
219 int duration_override = animation_speed_ms_; | 219 int duration_override = animation_speed_ms_; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 if (itr != window_to_entry_map.end()) { | 443 if (itr != window_to_entry_map.end()) { |
444 windows_by_user_id_[itr->second->show_for_user()].push_back( | 444 windows_by_user_id_[itr->second->show_for_user()].push_back( |
445 child_window); | 445 child_window); |
446 } | 446 } |
447 } | 447 } |
448 } | 448 } |
449 } | 449 } |
450 } | 450 } |
451 | 451 |
452 } // namespace chrome | 452 } // namespace chrome |
OLD | NEW |