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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 views::Widget::InitParams params( | 145 views::Widget::InitParams params( |
146 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 146 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
147 DesktopBackgroundView* view = new DesktopBackgroundView(); | 147 DesktopBackgroundView* view = new DesktopBackgroundView(); |
148 params.delegate = view; | 148 params.delegate = view; |
149 if (controller->GetWallpaper().empty()) | 149 if (controller->GetWallpaper().empty()) |
150 params.transparent = true; | 150 params.transparent = true; |
151 params.parent = root_window->GetChildById( | 151 params.parent = root_window->GetChildById( |
152 ash::internal::kShellWindowId_DesktopBackgroundContainer); | 152 ash::internal::kShellWindowId_DesktopBackgroundContainer); |
153 desktop_widget->Init(params); | 153 desktop_widget->Init(params); |
154 desktop_widget->SetContentsView(view); | 154 desktop_widget->SetContentsView(view); |
155 ash::SetWindowVisibilityAnimationType( | 155 ash::WindowVisibilityAnimationType animation_type = |
156 desktop_widget->GetNativeView(), | 156 ash::Shell::GetInstance()->user_wallpaper_delegate()->GetAnimationType(); |
157 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE); | 157 ash::SetWindowVisibilityAnimationType(desktop_widget->GetNativeView(), |
158 ash::SetWindowVisibilityAnimationTransition( | 158 animation_type); |
159 desktop_widget->GetNativeView(), | 159 ash::SetWindowVisibilityAnimationTransition(desktop_widget->GetNativeView(), |
160 ash::ANIMATE_SHOW); | 160 ash::ANIMATE_SHOW); |
161 desktop_widget->SetBounds(params.parent->bounds()); | 161 desktop_widget->SetBounds(params.parent->bounds()); |
162 ui::ScopedLayerAnimationSettings settings(desktop_widget->GetNativeView()-> | 162 ui::ScopedLayerAnimationSettings settings( |
163 layer()->GetAnimator()); | 163 desktop_widget->GetNativeView()->layer()->GetAnimator()); |
164 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); | 164 settings.SetPreemptionStrategy(ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); |
165 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, | 165 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, |
166 desktop_widget)); | 166 desktop_widget)); |
167 desktop_widget->Show(); | 167 desktop_widget->Show(); |
168 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); | 168 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); |
169 } | 169 } |
170 | 170 |
171 } // namespace internal | 171 } // namespace internal |
172 } // namespace ash | 172 } // namespace ash |
OLD | NEW |