| 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 ash::UserWallpaperDelegate* wallpaper_delegate = | 186 ash::UserWallpaperDelegate* wallpaper_delegate = |
| 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( | 196 chromeos::WallpaperManager::Get()->SetUserWallpaperNow(new_account_id_); |
| 197 new_account_id_.GetUserEmail()); | |
| 198 wallpaper_user_id_for_test_ = | 197 wallpaper_user_id_for_test_ = |
| 199 (NO_USER_COVERS_SCREEN == screen_cover_ ? "->" : "") + | 198 (NO_USER_COVERS_SCREEN == screen_cover_ ? "->" : "") + |
| 200 new_account_id_.GetUserEmail(); | 199 new_account_id_.Serialize(); |
| 201 } | 200 } |
| 202 } else if (animation_step == ANIMATION_STEP_FINALIZE) { | 201 } else if (animation_step == ANIMATION_STEP_FINALIZE) { |
| 203 // Revert the wallpaper cross dissolve animation duration back to the | 202 // Revert the wallpaper cross dissolve animation duration back to the |
| 204 // default. | 203 // default. |
| 205 if (screen_cover_ == NEW_USER_COVERS_SCREEN) | 204 if (screen_cover_ == NEW_USER_COVERS_SCREEN) |
| 206 chromeos::WallpaperManager::Get()->SetUserWallpaperNow( | 205 chromeos::WallpaperManager::Get()->SetUserWallpaperNow(new_account_id_); |
| 207 new_account_id_.GetUserEmail()); | |
| 208 | 206 |
| 209 // 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 |
| 210 // got here. | 208 // got here. |
| 211 wallpaper_user_id_for_test_ = new_account_id_.GetUserEmail(); | 209 wallpaper_user_id_for_test_ = new_account_id_.Serialize(); |
| 212 wallpaper_delegate->SetAnimationDurationOverride(0); | 210 wallpaper_delegate->SetAnimationDurationOverride(0); |
| 213 } | 211 } |
| 214 } | 212 } |
| 215 | 213 |
| 216 void UserSwitchAnimatorChromeOS::TransitionUserShelf( | 214 void UserSwitchAnimatorChromeOS::TransitionUserShelf( |
| 217 AnimationStep animation_step) { | 215 AnimationStep animation_step) { |
| 218 ChromeLauncherController* chrome_launcher_controller = | 216 ChromeLauncherController* chrome_launcher_controller = |
| 219 ChromeLauncherController::instance(); | 217 ChromeLauncherController::instance(); |
| 220 // The shelf animation duration override. | 218 // The shelf animation duration override. |
| 221 int duration_override = animation_speed_ms_; | 219 int duration_override = animation_speed_ms_; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 if (itr != window_to_entry_map.end()) { | 445 if (itr != window_to_entry_map.end()) { |
| 448 windows_by_account_id_[itr->second->show_for_user()].push_back( | 446 windows_by_account_id_[itr->second->show_for_user()].push_back( |
| 449 child_window); | 447 child_window); |
| 450 } | 448 } |
| 451 } | 449 } |
| 452 } | 450 } |
| 453 } | 451 } |
| 454 } | 452 } |
| 455 | 453 |
| 456 } // namespace chrome | 454 } // namespace chrome |
| OLD | NEW |