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 "ash/desktop_background/desktop_background_view.h" | 5 #include "ash/desktop_background/desktop_background_view.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // Enable wallpaper transition for the following cases: | 200 // Enable wallpaper transition for the following cases: |
201 // 1. Initial(OOBE) wallpaper animation. | 201 // 1. Initial(OOBE) wallpaper animation. |
202 // 2. Wallpaper fades in from a non empty background. | 202 // 2. Wallpaper fades in from a non empty background. |
203 // 3. From an empty background, chrome transit to a logged in user session. | 203 // 3. From an empty background, chrome transit to a logged in user session. |
204 // 4. From an empty background, guest user logged in. | 204 // 4. From an empty background, guest user logged in. |
205 if (wallpaper_delegate->ShouldShowInitialAnimation() || | 205 if (wallpaper_delegate->ShouldShowInitialAnimation() || |
206 root_window_controller->animating_wallpaper_controller() || | 206 root_window_controller->animating_wallpaper_controller() || |
207 Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { | 207 Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { |
208 views::corewm::SetWindowVisibilityAnimationTransition( | 208 views::corewm::SetWindowVisibilityAnimationTransition( |
209 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); | 209 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); |
| 210 int duration_override = wallpaper_delegate->GetAnimationDurationOverride(); |
| 211 if (duration_override) { |
| 212 views::corewm::SetWindowVisibilityAnimationDuration( |
| 213 desktop_widget->GetNativeView(), |
| 214 base::TimeDelta::FromMilliseconds(duration_override)); |
| 215 } |
210 } else { | 216 } else { |
211 // Disable animation if transition to login screen from an empty background. | 217 // Disable animation if transition to login screen from an empty background. |
212 views::corewm::SetWindowVisibilityAnimationTransition( | 218 views::corewm::SetWindowVisibilityAnimationTransition( |
213 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); | 219 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); |
214 } | 220 } |
215 | 221 |
216 desktop_widget->SetBounds(params.parent->bounds()); | 222 desktop_widget->SetBounds(params.parent->bounds()); |
217 return desktop_widget; | 223 return desktop_widget; |
218 } | 224 } |
219 | 225 |
220 } // namespace internal | 226 } // namespace internal |
221 } // namespace ash | 227 } // namespace ash |
OLD | NEW |