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" |
11 #include "ash/desktop_background/desktop_background_widget_controller.h" | 11 #include "ash/desktop_background/desktop_background_widget_controller.h" |
| 12 #include "ash/root_window_controller.h" |
12 #include "ash/shell.h" | 13 #include "ash/shell.h" |
13 #include "ash/shell_window_ids.h" | 14 #include "ash/shell_window_ids.h" |
14 #include "ash/wm/window_animations.h" | 15 #include "ash/wm/window_animations.h" |
15 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
16 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
17 #include "ui/aura/root_window.h" | 18 #include "ui/aura/root_window.h" |
18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
19 #include "ui/compositor/layer.h" | 20 #include "ui/compositor/layer.h" |
20 #include "ui/compositor/layer_animation_observer.h" | 21 #include "ui/compositor/layer_animation_observer.h" |
21 #include "ui/compositor/scoped_layer_animation_settings.h" | 22 #include "ui/compositor/scoped_layer_animation_settings.h" |
(...skipping 18 matching lines...) Expand all Loading... |
40 | 41 |
41 virtual ~ShowWallpaperAnimationObserver() { | 42 virtual ~ShowWallpaperAnimationObserver() { |
42 if (desktop_widget_) | 43 if (desktop_widget_) |
43 desktop_widget_->GetNativeView()->RemoveObserver(this); | 44 desktop_widget_->GetNativeView()->RemoveObserver(this); |
44 } | 45 } |
45 | 46 |
46 private: | 47 private: |
47 // Overridden from ui::ImplicitAnimationObserver: | 48 // Overridden from ui::ImplicitAnimationObserver: |
48 virtual void OnImplicitAnimationsCompleted() OVERRIDE { | 49 virtual void OnImplicitAnimationsCompleted() OVERRIDE { |
49 ash::Shell* shell = ash::Shell::GetInstance(); | 50 ash::Shell* shell = ash::Shell::GetInstance(); |
| 51 shell->GetPrimaryRootWindowController()->HandleDesktopBackgroundVisible(); |
50 shell->user_wallpaper_delegate()->OnWallpaperAnimationFinished(); | 52 shell->user_wallpaper_delegate()->OnWallpaperAnimationFinished(); |
51 // Only removes old component when wallpaper animation finished. If we | 53 // Only removes old component when wallpaper animation finished. If we |
52 // remove the old one too early, there will be a white flash during | 54 // remove the old one too early, there will be a white flash during |
53 // animation. | 55 // animation. |
54 if (root_window_->GetProperty(kComponentWrapper)) { | 56 if (root_window_->GetProperty(kComponentWrapper)) { |
55 internal::DesktopBackgroundWidgetController* component = | 57 internal::DesktopBackgroundWidgetController* component = |
56 root_window_->GetProperty(kComponentWrapper)->GetComponent(true); | 58 root_window_->GetProperty(kComponentWrapper)->GetComponent(true); |
57 root_window_->SetProperty(kWindowDesktopComponent, component); | 59 root_window_->SetProperty(kWindowDesktopComponent, component); |
58 } | 60 } |
59 desktop_widget_->GetNativeView()->RemoveObserver(this); | 61 desktop_widget_->GetNativeView()->RemoveObserver(this); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); | 186 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); |
185 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, | 187 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, |
186 desktop_widget)); | 188 desktop_widget)); |
187 desktop_widget->Show(); | 189 desktop_widget->Show(); |
188 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); | 190 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); |
189 return desktop_widget; | 191 return desktop_widget; |
190 } | 192 } |
191 | 193 |
192 } // namespace internal | 194 } // namespace internal |
193 } // namespace ash | 195 } // namespace ash |
OLD | NEW |