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

Side by Side Diff: ash/desktop_background/desktop_background_view.cc

Issue 196063002: Move wm/core to wm namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ash/default_user_wallpaper_delegate.cc ('k') | ash/display/screen_position_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 views::Widget* desktop_widget = new views::Widget; 184 views::Widget* desktop_widget = new views::Widget;
185 views::Widget::InitParams params( 185 views::Widget::InitParams params(
186 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 186 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
187 if (controller->GetWallpaper().isNull()) 187 if (controller->GetWallpaper().isNull())
188 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 188 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
189 params.parent = root_window->GetChildById(container_id); 189 params.parent = root_window->GetChildById(container_id);
190 desktop_widget->Init(params); 190 desktop_widget->Init(params);
191 desktop_widget->SetContentsView( 191 desktop_widget->SetContentsView(
192 new LayerControlView(new DesktopBackgroundView())); 192 new LayerControlView(new DesktopBackgroundView()));
193 int animation_type = wallpaper_delegate->GetAnimationType(); 193 int animation_type = wallpaper_delegate->GetAnimationType();
194 views::corewm::SetWindowVisibilityAnimationType( 194 wm::SetWindowVisibilityAnimationType(
195 desktop_widget->GetNativeView(), animation_type); 195 desktop_widget->GetNativeView(), animation_type);
196 196
197 RootWindowController* root_window_controller = 197 RootWindowController* root_window_controller =
198 GetRootWindowController(root_window); 198 GetRootWindowController(root_window);
199 199
200 // Enable wallpaper transition for the following cases: 200 // Enable wallpaper transition for the following cases:
201 // 1. Initial(OOBE) wallpaper animation. 201 // 1. Initial(OOBE) wallpaper animation.
202 // 2. Wallpaper fades in from a non empty background. 202 // 2. Wallpaper fades in from a non empty background.
203 // 3. From an empty background, chrome transit to a logged in user session. 203 // 3. From an empty background, chrome transit to a logged in user session.
204 // 4. From an empty background, guest user logged in. 204 // 4. From an empty background, guest user logged in.
205 if (wallpaper_delegate->ShouldShowInitialAnimation() || 205 if (wallpaper_delegate->ShouldShowInitialAnimation() ||
206 root_window_controller->animating_wallpaper_controller() || 206 root_window_controller->animating_wallpaper_controller() ||
207 Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) { 207 Shell::GetInstance()->session_state_delegate()->NumberOfLoggedInUsers()) {
208 views::corewm::SetWindowVisibilityAnimationTransition( 208 wm::SetWindowVisibilityAnimationTransition(
209 desktop_widget->GetNativeView(), views::corewm::ANIMATE_SHOW); 209 desktop_widget->GetNativeView(), wm::ANIMATE_SHOW);
210 int duration_override = wallpaper_delegate->GetAnimationDurationOverride(); 210 int duration_override = wallpaper_delegate->GetAnimationDurationOverride();
211 if (duration_override) { 211 if (duration_override) {
212 views::corewm::SetWindowVisibilityAnimationDuration( 212 wm::SetWindowVisibilityAnimationDuration(
213 desktop_widget->GetNativeView(), 213 desktop_widget->GetNativeView(),
214 base::TimeDelta::FromMilliseconds(duration_override)); 214 base::TimeDelta::FromMilliseconds(duration_override));
215 } 215 }
216 } else { 216 } else {
217 // Disable animation if transition to login screen from an empty background. 217 // Disable animation if transition to login screen from an empty background.
218 views::corewm::SetWindowVisibilityAnimationTransition( 218 wm::SetWindowVisibilityAnimationTransition(
219 desktop_widget->GetNativeView(), views::corewm::ANIMATE_NONE); 219 desktop_widget->GetNativeView(), wm::ANIMATE_NONE);
220 } 220 }
221 221
222 desktop_widget->SetBounds(params.parent->bounds()); 222 desktop_widget->SetBounds(params.parent->bounds());
223 return desktop_widget; 223 return desktop_widget;
224 } 224 }
225 225
226 } // namespace internal 226 } // namespace internal
227 } // namespace ash 227 } // namespace ash
OLDNEW
« no previous file with comments | « ash/default_user_wallpaper_delegate.cc ('k') | ash/display/screen_position_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698