Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Side by Side Diff: trunk/src/ash/desktop_background/desktop_background_view.cc

Issue 14200034: Revert 194578 "Add ash SessionStateDelegate" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « trunk/src/ash/ash.gyp ('k') | trunk/src/ash/root_window_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ash/desktop_background/desktop_background_widget_controller.h" 11 #include "ash/desktop_background/desktop_background_widget_controller.h"
12 #include "ash/desktop_background/user_wallpaper_delegate.h" 12 #include "ash/desktop_background/user_wallpaper_delegate.h"
13 #include "ash/root_window_controller.h" 13 #include "ash/root_window_controller.h"
14 #include "ash/session_state_delegate.h"
15 #include "ash/shell.h" 14 #include "ash/shell.h"
15 #include "ash/shell_delegate.h"
16 #include "ash/shell_window_ids.h" 16 #include "ash/shell_window_ids.h"
17 #include "ash/wm/property_util.h" 17 #include "ash/wm/property_util.h"
18 #include "ash/wm/window_animations.h" 18 #include "ash/wm/window_animations.h"
19 #include "base/message_loop.h" 19 #include "base/message_loop.h"
20 #include "base/utf_string_conversions.h" 20 #include "base/utf_string_conversions.h"
21 #include "ui/aura/root_window.h" 21 #include "ui/aura/root_window.h"
22 #include "ui/base/resource/resource_bundle.h" 22 #include "ui/base/resource/resource_bundle.h"
23 #include "ui/compositor/layer.h" 23 #include "ui/compositor/layer.h"
24 #include "ui/compositor/layer_animation_observer.h" 24 #include "ui/compositor/layer_animation_observer.h"
25 #include "ui/compositor/scoped_layer_animation_settings.h" 25 #include "ui/compositor/scoped_layer_animation_settings.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 views::corewm::SetWindowVisibilityAnimationType( 194 views::corewm::SetWindowVisibilityAnimationType(
195 desktop_widget->GetNativeView(), animation_type); 195 desktop_widget->GetNativeView(), animation_type);
196 196
197 // Enable wallpaper transition for the following cases: 197 // Enable wallpaper transition for the following cases:
198 // 1. Initial(OOBE) wallpaper animation. 198 // 1. Initial(OOBE) wallpaper animation.
199 // 2. Wallpaper fades in from a non empty background. 199 // 2. Wallpaper fades in from a non empty background.
200 // 3. From an empty background, chrome transit to a logged in user session. 200 // 3. From an empty background, chrome transit to a logged in user session.
201 // 4. From an empty background, guest user logged in. 201 // 4. From an empty background, guest user logged in.
202 if (wallpaper_delegate->ShouldShowInitialAnimation() || 202 if (wallpaper_delegate->ShouldShowInitialAnimation() ||
203 root_window->GetProperty(kAnimatingDesktopController) || 203 root_window->GetProperty(kAnimatingDesktopController) ||
204 Shell::GetInstance()->session_state_delegate()->HasActiveUser()) { 204 Shell::GetInstance()->delegate()->IsGuestSession() ||
205 Shell::GetInstance()->delegate()->IsUserLoggedIn()) {
205 views::corewm::SetWindowVisibilityAnimationTransition( 206 views::corewm::SetWindowVisibilityAnimationTransition(
206 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); 207 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW);
207 } else { 208 } else {
208 // Disable animation if transition to login screen from an empty background. 209 // Disable animation if transition to login screen from an empty background.
209 views::corewm::SetWindowVisibilityAnimationTransition( 210 views::corewm::SetWindowVisibilityAnimationTransition(
210 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); 211 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE);
211 } 212 }
212 213
213 desktop_widget->SetBounds(params.parent->bounds()); 214 desktop_widget->SetBounds(params.parent->bounds());
214 ui::ScopedLayerAnimationSettings settings( 215 ui::ScopedLayerAnimationSettings settings(
215 desktop_widget->GetNativeView()->layer()->GetAnimator()); 216 desktop_widget->GetNativeView()->layer()->GetAnimator());
216 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); 217 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
217 settings.AddObserver(new ShowWallpaperAnimationObserver( 218 settings.AddObserver(new ShowWallpaperAnimationObserver(
218 root_window, desktop_widget, 219 root_window, desktop_widget,
219 wallpaper_delegate->ShouldShowInitialAnimation())); 220 wallpaper_delegate->ShouldShowInitialAnimation()));
220 desktop_widget->Show(); 221 desktop_widget->Show();
221 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); 222 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView");
222 return desktop_widget; 223 return desktop_widget;
223 } 224 }
224 225
225 } // namespace internal 226 } // namespace internal
226 } // namespace ash 227 } // namespace ash
OLDNEW
« no previous file with comments | « trunk/src/ash/ash.gyp ('k') | trunk/src/ash/root_window_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698