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

Side by Side Diff: ash/common/wallpaper/wallpaper_view.cc

Issue 2620153003: Folds WmRootWindowController into RootWindowController (Closed)
Patch Set: merge Created 3 years, 11 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
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/common/wallpaper/wallpaper_view.h" 5 #include "ash/common/wallpaper/wallpaper_view.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/wallpaper/wallpaper_controller.h" 8 #include "ash/common/wallpaper/wallpaper_controller.h"
9 #include "ash/common/wallpaper/wallpaper_delegate.h" 9 #include "ash/common/wallpaper/wallpaper_delegate.h"
10 #include "ash/common/wallpaper/wallpaper_widget_controller.h" 10 #include "ash/common/wallpaper/wallpaper_widget_controller.h"
11 #include "ash/common/wm/overview/window_selector_controller.h" 11 #include "ash/common/wm/overview/window_selector_controller.h"
12 #include "ash/common/wm_lookup.h" 12 #include "ash/common/wm_lookup.h"
13 #include "ash/common/wm_root_window_controller.h"
14 #include "ash/common/wm_shell.h" 13 #include "ash/common/wm_shell.h"
15 #include "ash/common/wm_window.h" 14 #include "ash/common/wm_window.h"
15 #include "ash/root_window_controller.h"
16 #include "ui/display/display.h" 16 #include "ui/display/display.h"
17 #include "ui/display/manager/managed_display_info.h" 17 #include "ui/display/manager/managed_display_info.h"
18 #include "ui/display/screen.h" 18 #include "ui/display/screen.h"
19 #include "ui/gfx/canvas.h" 19 #include "ui/gfx/canvas.h"
20 #include "ui/gfx/geometry/safe_integer_conversions.h" 20 #include "ui/gfx/geometry/safe_integer_conversions.h"
21 #include "ui/gfx/geometry/size_conversions.h" 21 #include "ui/gfx/geometry/size_conversions.h"
22 #include "ui/gfx/transform.h" 22 #include "ui/gfx/transform.h"
23 #include "ui/views/widget/widget.h" 23 #include "ui/views/widget/widget.h"
24 24
25 namespace ash { 25 namespace ash {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 203 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
204 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer( 204 root_window->GetRootWindowController()->ConfigureWidgetInitParamsForContainer(
205 wallpaper_widget, container_id, &params); 205 wallpaper_widget, container_id, &params);
206 wallpaper_widget->Init(params); 206 wallpaper_widget->Init(params);
207 wallpaper_widget->SetContentsView(new LayerControlView(new WallpaperView())); 207 wallpaper_widget->SetContentsView(new LayerControlView(new WallpaperView()));
208 int animation_type = wallpaper_delegate->GetAnimationType(); 208 int animation_type = wallpaper_delegate->GetAnimationType();
209 WmWindow* wallpaper_window = 209 WmWindow* wallpaper_window =
210 WmLookup::Get()->GetWindowForWidget(wallpaper_widget); 210 WmLookup::Get()->GetWindowForWidget(wallpaper_widget);
211 wallpaper_window->SetVisibilityAnimationType(animation_type); 211 wallpaper_window->SetVisibilityAnimationType(animation_type);
212 212
213 WmRootWindowController* root_window_controller = 213 RootWindowController* root_window_controller =
214 root_window->GetRootWindowController(); 214 root_window->GetRootWindowController();
215 215
216 // Enable wallpaper transition for the following cases: 216 // Enable wallpaper transition for the following cases:
217 // 1. Initial(OOBE) wallpaper animation. 217 // 1. Initial(OOBE) wallpaper animation.
218 // 2. Wallpaper fades in from a non empty background. 218 // 2. Wallpaper fades in from a non empty background.
219 // 3. From an empty background, chrome transit to a logged in user session. 219 // 3. From an empty background, chrome transit to a logged in user session.
220 // 4. From an empty background, guest user logged in. 220 // 4. From an empty background, guest user logged in.
221 if (wallpaper_delegate->ShouldShowInitialAnimation() || 221 if (wallpaper_delegate->ShouldShowInitialAnimation() ||
222 root_window_controller->animating_wallpaper_widget_controller() || 222 root_window_controller->animating_wallpaper_widget_controller() ||
223 WmShell::Get()->GetSessionStateDelegate()->NumberOfLoggedInUsers()) { 223 WmShell::Get()->GetSessionStateDelegate()->NumberOfLoggedInUsers()) {
224 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_SHOW); 224 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_SHOW);
225 int duration_override = wallpaper_delegate->GetAnimationDurationOverride(); 225 int duration_override = wallpaper_delegate->GetAnimationDurationOverride();
226 if (duration_override) { 226 if (duration_override) {
227 wallpaper_window->SetVisibilityAnimationDuration( 227 wallpaper_window->SetVisibilityAnimationDuration(
228 base::TimeDelta::FromMilliseconds(duration_override)); 228 base::TimeDelta::FromMilliseconds(duration_override));
229 } 229 }
230 } else { 230 } else {
231 // Disable animation if transition to login screen from an empty background. 231 // Disable animation if transition to login screen from an empty background.
232 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE); 232 wallpaper_window->SetVisibilityAnimationTransition(::wm::ANIMATE_NONE);
233 } 233 }
234 234
235 WmWindow* container = root_window->GetChildByShellWindowId(container_id); 235 WmWindow* container = root_window->GetChildByShellWindowId(container_id);
236 wallpaper_widget->SetBounds(container->GetBounds()); 236 wallpaper_widget->SetBounds(container->GetBounds());
237 return wallpaper_widget; 237 return wallpaper_widget;
238 } 238 }
239 239
240 } // namespace ash 240 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/wallpaper/wallpaper_controller_unittest.cc ('k') | ash/common/wallpaper/wallpaper_widget_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698