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

Unified Diff: chrome/browser/chromeos/background/ash_user_wallpaper_delegate.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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
diff --git a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
index 96be6ec9f1848d0846356074080467c9fdd5bdd9..edbb7a34f7d5717b3d6ef029b8e1ed7d3578b8d3 100644
--- a/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
+++ b/chrome/browser/chromeos/background/ash_user_wallpaper_delegate.cc
@@ -25,27 +25,38 @@ namespace chromeos {
namespace {
-class UserWallpaperDelegate: public ash::UserWallpaperDelegate {
+bool IsNormalWallpaperChange() {
+ if (chromeos::UserManager::Get()->IsUserLoggedIn() ||
+ CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe) ||
+ WizardController::IsZeroDelayEnabled() ||
+ !CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginManager)) {
+ return true;
+ }
+
+ return false;
+}
+
+class UserWallpaperDelegate : public ash::UserWallpaperDelegate {
public:
- UserWallpaperDelegate() {
+ UserWallpaperDelegate() : boot_animation_finished_(false) {
}
virtual ~UserWallpaperDelegate() {
}
virtual ash::WindowVisibilityAnimationType GetAnimationType() OVERRIDE {
- if (CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableNewOobe) ||
- WizardController::IsZeroDelayEnabled()) {
+ if (IsNormalWallpaperChange() || boot_animation_finished_)
return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE;
- }
+ // It is a first boot case now. If kDisableBootAnimation flag
+ // is passed, it only disables any transition after OOBE.
bool is_registered = WizardController::IsDeviceRegistered();
- // TODO(nkostylev): Figure out whether this would affect autotests as well.
- if (is_registered)
+ bool disable_boot_animation = CommandLine::ForCurrentProcess()->
+ HasSwitch(switches::kDisableBootAnimation);
+ if (is_registered && disable_boot_animation)
return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_FADE;
- else
- return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE;
+
+ return ash::WINDOW_VISIBILITY_ANIMATION_TYPE_BRIGHTNESS_GRAYSCALE;
}
virtual void InitializeWallpaper() OVERRIDE {
@@ -67,7 +78,14 @@ class UserWallpaperDelegate: public ash::UserWallpaperDelegate {
content::NotificationService::NoDetails());
}
+ virtual void OnWallpaperBootAnimationFinished() OVERRIDE {
+ // Make sure that boot animation type is used only once.
+ boot_animation_finished_ = true;
+ }
+
private:
+ bool boot_animation_finished_;
+
DISALLOW_COPY_AND_ASSIGN(UserWallpaperDelegate);
};
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698