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

Side by Side Diff: chrome/browser/chromeos/login/user_manager_impl.cc

Issue 10834081: Enable wallpaper boot animation for boot into sign in too. Add flag to disable it. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 8 years, 4 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 "chrome/browser/chromeos/login/user_manager_impl.h" 5 #include "chrome/browser/chromeos/login/user_manager_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/desktop_background/desktop_background_controller.h" 9 #include "ash/desktop_background/desktop_background_controller.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 is_current_user_new_ = true; 369 is_current_user_new_ = true;
370 is_current_user_ephemeral_ = true; 370 is_current_user_ephemeral_ = true;
371 logged_in_user_ = CreateUser(email, /* is_ephemeral= */ true); 371 logged_in_user_ = CreateUser(email, /* is_ephemeral= */ true);
372 SetInitialUserImage(email); 372 SetInitialUserImage(email);
373 SetInitialUserWallpaper(email); 373 SetInitialUserWallpaper(email);
374 NotifyOnLogin(); 374 NotifyOnLogin();
375 } 375 }
376 376
377 void UserManagerImpl::InitializeWallpaper() { 377 void UserManagerImpl::InitializeWallpaper() {
378 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 378 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
379
380 if (WizardController::IsZeroDelayEnabled())
381 return;
382
383 bool disable_new_oobe = CommandLine::ForCurrentProcess()->
384 HasSwitch(switches::kDisableNewOobe);
385 bool disable_boot_animation = CommandLine::ForCurrentProcess()->
386 HasSwitch(switches::kDisableBootAnimation);
387
379 if (!IsUserLoggedIn()) { 388 if (!IsUserLoggedIn()) {
380 if (!CommandLine::ForCurrentProcess()->HasSwitch( 389 if (!disable_new_oobe) {
381 switches::kDisableNewOobe)) { 390 if (!WizardController::IsDeviceRegistered()) {
382 if (!WizardController::IsDeviceRegistered() &&
383 !WizardController::IsZeroDelayEnabled()) {
384 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE. 391 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE.
385 // Should be used on test images so that they are not slowed down. 392 // Should be used on test images so that they are not slowed down.
386 ash::Shell::GetInstance()->desktop_background_controller()-> 393 ash::Shell::GetInstance()->desktop_background_controller()->
387 SetDefaultWallpaper(kDefaultOOBEWallpaperIndex); 394 SetDefaultWallpaper(kDefaultOOBEWallpaperIndex);
388 } else { 395 } else {
389 bool show_users = true; 396 bool show_users = true;
390 bool result = CrosSettings::Get()->GetBoolean( 397 bool result = CrosSettings::Get()->GetBoolean(
391 kAccountsPrefShowUserNamesOnSignIn, &show_users); 398 kAccountsPrefShowUserNamesOnSignIn, &show_users);
392 DCHECK(result) << "Unable to fetch setting " 399 DCHECK(result) << "Unable to fetch setting "
393 << kAccountsPrefShowUserNamesOnSignIn; 400 << kAccountsPrefShowUserNamesOnSignIn;
394 if (!show_users) { 401 if (!show_users) {
402 // Boot into sign in form, preload default wallpaper.
395 ash::Shell::GetInstance()->desktop_background_controller()-> 403 ash::Shell::GetInstance()->desktop_background_controller()->
396 SetDefaultWallpaper(ash::GetSolidColorIndex()); 404 SetDefaultWallpaper(kDefaultOOBEWallpaperIndex);
405 } else if (!disable_boot_animation) {
406 // Normal boot, load user wallpaper.
407 const chromeos::UserList& users = GetUsers();
408 if (!users.empty()) {
409 UserSelected(users[0]->email());
410 } else {
411 ash::Shell::GetInstance()->desktop_background_controller()->
412 SetDefaultWallpaper(kDefaultOOBEWallpaperIndex);
413 }
397 } 414 }
398 } 415 }
399 } 416 }
400 return; 417 return;
401 } 418 }
402 UserSelected(GetLoggedInUser().email()); 419 UserSelected(GetLoggedInUser().email());
403 } 420 }
404 421
405 void UserManagerImpl::UserSelected(const std::string& email) { 422 void UserManagerImpl::UserSelected(const std::string& email) {
406 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 423 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after
1689 BrowserThread::PostTask( 1706 BrowserThread::PostTask(
1690 BrowserThread::FILE, 1707 BrowserThread::FILE,
1691 FROM_HERE, 1708 FROM_HERE,
1692 base::Bind(&UserManagerImpl::DeleteUserImage, 1709 base::Bind(&UserManagerImpl::DeleteUserImage,
1693 base::Unretained(this), 1710 base::Unretained(this),
1694 image_path)); 1711 image_path));
1695 } 1712 }
1696 } 1713 }
1697 1714
1698 } // namespace chromeos 1715 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | chrome/browser/chromeos/login/webui_login_display_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698