| 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, | 147 views::Widget* CreateDesktopBackground(aura::RootWindow* root_window, |
| 148 int container_id) { | 148 int container_id) { |
| 149 DesktopBackgroundController* controller = ash::Shell::GetInstance()-> | 149 DesktopBackgroundController* controller = ash::Shell::GetInstance()-> |
| 150 desktop_background_controller(); | 150 desktop_background_controller(); |
| 151 views::Widget* desktop_widget = new views::Widget; | 151 views::Widget* desktop_widget = new views::Widget; |
| 152 views::Widget::InitParams params( | 152 views::Widget::InitParams params( |
| 153 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 153 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
| 154 DesktopBackgroundView* view = new DesktopBackgroundView(); | 154 DesktopBackgroundView* view = new DesktopBackgroundView(); |
| 155 params.delegate = view; | 155 params.delegate = view; |
| 156 if (controller->GetWallpaper().empty()) | 156 if (controller->GetWallpaper().isNull()) |
| 157 params.transparent = true; | 157 params.transparent = true; |
| 158 params.parent = root_window->GetChildById(container_id); | 158 params.parent = root_window->GetChildById(container_id); |
| 159 desktop_widget->Init(params); | 159 desktop_widget->Init(params); |
| 160 desktop_widget->SetContentsView(view); | 160 desktop_widget->SetContentsView(view); |
| 161 ash::WindowVisibilityAnimationType animation_type = | 161 ash::WindowVisibilityAnimationType animation_type = |
| 162 ash::Shell::GetInstance()->user_wallpaper_delegate()->GetAnimationType(); | 162 ash::Shell::GetInstance()->user_wallpaper_delegate()->GetAnimationType(); |
| 163 ash::SetWindowVisibilityAnimationType(desktop_widget->GetNativeView(), | 163 ash::SetWindowVisibilityAnimationType(desktop_widget->GetNativeView(), |
| 164 animation_type); | 164 animation_type); |
| 165 // Disable animation when creating the first widget. Otherwise, wallpaper | 165 // Disable animation when creating the first widget. Otherwise, wallpaper |
| 166 // will animate from a white screen. Note that boot animation is different. | 166 // will animate from a white screen. Note that boot animation is different. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 180 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, | 180 settings.AddObserver(new ShowWallpaperAnimationObserver(root_window, |
| 181 container_id, | 181 container_id, |
| 182 desktop_widget)); | 182 desktop_widget)); |
| 183 desktop_widget->Show(); | 183 desktop_widget->Show(); |
| 184 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); | 184 desktop_widget->GetNativeView()->SetName("DesktopBackgroundView"); |
| 185 return desktop_widget; | 185 return desktop_widget; |
| 186 } | 186 } |
| 187 | 187 |
| 188 } // namespace internal | 188 } // namespace internal |
| 189 } // namespace ash | 189 } // namespace ash |
| OLD | NEW |