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

Unified Diff: ash/desktop_background/desktop_background_view.cc

Issue 10834308: Reland "Fix white flash when user signs out and fix wallpaper animation regression" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: ash/desktop_background/desktop_background_view.cc
diff --git a/ash/desktop_background/desktop_background_view.cc b/ash/desktop_background/desktop_background_view.cc
index ea324e9370b77c32e39281bd3930644128f2e04e..fcbd935639c5114f0ca42976826fc600b914106d 100644
--- a/ash/desktop_background/desktop_background_view.cc
+++ b/ash/desktop_background/desktop_background_view.cc
@@ -8,6 +8,7 @@
#include "ash/ash_export.h"
#include "ash/desktop_background/desktop_background_controller.h"
+#include "ash/desktop_background/desktop_background_widget_controller.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/wm/window_animations.h"
@@ -43,8 +44,16 @@ class ShowWallpaperAnimationObserver : public ui::ImplicitAnimationObserver {
private:
// Overridden from ui::ImplicitAnimationObserver:
virtual void OnImplicitAnimationsCompleted() OVERRIDE {
- ash::Shell::GetInstance()->
- user_wallpaper_delegate()->OnWallpaperAnimationFinished();
+ ash::Shell* shell = ash::Shell::GetInstance();
+ shell->user_wallpaper_delegate()->OnWallpaperAnimationFinished();
+ // Only removes old component when wallpaper animation finished. If we
+ // remove the old one too early, there will be a white flash during
+ // animation.
+ if (root_window_->GetProperty(kComponentWrapper)) {
+ internal::DesktopBackgroundWidgetController* component =
+ root_window_->GetProperty(kComponentWrapper)->component();
+ root_window_->SetProperty(kWindowDesktopComponent, component);
+ }
MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
@@ -153,8 +162,17 @@ views::Widget* CreateDesktopBackground(aura::RootWindow* root_window,
ash::Shell::GetInstance()->user_wallpaper_delegate()->GetAnimationType();
ash::SetWindowVisibilityAnimationType(desktop_widget->GetNativeView(),
animation_type);
- ash::SetWindowVisibilityAnimationTransition(desktop_widget->GetNativeView(),
- ash::ANIMATE_SHOW);
+ // Disable animation when creating the first widget. Otherwise, wallpaper
+ // will animate from a white screen. Note that boot animation is different.
+ // It animates from a white background.
+ if (animation_type == ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE &&
+ NULL == root_window->GetProperty(internal::kComponentWrapper)) {
+ ash::SetWindowVisibilityAnimationTransition(desktop_widget->GetNativeView(),
+ ash::ANIMATE_NONE);
+ } else {
+ ash::SetWindowVisibilityAnimationTransition(desktop_widget->GetNativeView(),
+ ash::ANIMATE_SHOW);
+ }
desktop_widget->SetBounds(params.parent->bounds());
ui::ScopedLayerAnimationSettings settings(
desktop_widget->GetNativeView()->layer()->GetAnimator());
« no previous file with comments | « ash/desktop_background/desktop_background_controller.cc ('k') | ash/desktop_background/desktop_background_widget_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698