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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_display_host.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: review + SetZeroDelays in tests 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/webui_login_display_host.h" 5 #include "chrome/browser/chromeos/login/webui_login_display_host.h"
6 6
7 #include "ash/desktop_background/desktop_background_controller.h"
7 #include "ash/shell.h" 8 #include "ash/shell.h"
8 #include "ash/shell_window_ids.h" 9 #include "ash/shell_window_ids.h"
9 #include "ash/wm/window_animations.h" 10 #include "ash/wm/window_animations.h"
10 #include "base/command_line.h" 11 #include "base/command_line.h"
11 #include "base/logging.h" 12 #include "base/logging.h"
12 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
13 #include "base/time.h" 14 #include "base/time.h"
14 #include "base/values.h" 15 #include "base/values.h"
15 #include "chrome/browser/browser_shutdown.h" 16 #include "chrome/browser/browser_shutdown.h"
16 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" 17 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 is_showing_login_(false), 55 is_showing_login_(false),
55 is_wallpaper_loaded_(false), 56 is_wallpaper_loaded_(false),
56 crash_count_(0), 57 crash_count_(0),
57 restore_path_(RESTORE_UNKNOWN) { 58 restore_path_(RESTORE_UNKNOWN) {
58 bool is_registered = WizardController::IsDeviceRegistered(); 59 bool is_registered = WizardController::IsDeviceRegistered();
59 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE. 60 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE.
60 // Should be used on test images so that they are not slowed down. 61 // Should be used on test images so that they are not slowed down.
61 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); 62 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled();
62 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe) && 63 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe) &&
63 !zero_delay_enabled) { 64 !zero_delay_enabled) {
64 waiting_for_wallpaper_load_ = !is_registered; 65 bool disable_boot_animation =
66 CommandLine::ForCurrentProcess()->
Ben Goodger (Google) 2012/08/02 15:38:39 up to prev line
Nikita (slow) 2012/08/02 17:58:57 Done.
67 HasSwitch(switches::kDisableBootAnimation);
68 waiting_for_wallpaper_load_ = !is_registered || !disable_boot_animation;
65 } else { 69 } else {
66 waiting_for_wallpaper_load_ = false; 70 waiting_for_wallpaper_load_ = false;
67 } 71 }
68 72
69 if (waiting_for_wallpaper_load_) { 73 if (waiting_for_wallpaper_load_) {
70 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, 74 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
71 content::NotificationService::AllSources()); 75 content::NotificationService::AllSources());
72 // Prevents white flashing on OOBE (http://crbug.com/131569). 76 // Prevents white flashing on OOBE (http://crbug.com/131569).
73 aura::Env::GetInstance()->set_render_white_bg(false); 77 aura::Env::GetInstance()->set_render_white_bg(false);
74 } 78 }
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 170 }
167 } 171 }
168 172
169 void WebUILoginDisplayHost::Observe( 173 void WebUILoginDisplayHost::Observe(
170 int type, 174 int type,
171 const content::NotificationSource& source, 175 const content::NotificationSource& source,
172 const content::NotificationDetails& details) { 176 const content::NotificationDetails& details) {
173 BaseLoginDisplayHost::Observe(type, source, details); 177 BaseLoginDisplayHost::Observe(type, source, details);
174 if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { 178 if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) {
175 is_wallpaper_loaded_ = true; 179 is_wallpaper_loaded_ = true;
180 ash::Shell::GetInstance()->
181 user_wallpaper_delegate()->OnWallpaperBootAnimationFinished();
Ben Goodger (Google) 2012/08/02 15:38:39 move the user_wallpaper.. up to the previous line.
Nikita (slow) 2012/08/02 17:58:57 Done.
176 if (waiting_for_wallpaper_load_) 182 if (waiting_for_wallpaper_load_)
177 StartPostponedWebUI(); 183 StartPostponedWebUI();
178 registrar_.Remove(this, 184 registrar_.Remove(this,
179 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, 185 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
180 content::NotificationService::AllSources()); 186 content::NotificationService::AllSources());
181 } 187 }
182 } 188 }
183 189
184 void WebUILoginDisplayHost::LoadURL(const GURL& url) { 190 void WebUILoginDisplayHost::LoadURL(const GURL& url) {
185 if (!login_window_) { 191 if (!login_window_) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 case RESTORE_SIGN_IN: 290 case RESTORE_SIGN_IN:
285 StartSignInScreen(); 291 StartSignInScreen();
286 break; 292 break;
287 default: 293 default:
288 NOTREACHED(); 294 NOTREACHED();
289 break; 295 break;
290 } 296 }
291 } 297 }
292 298
293 } // namespace chromeos 299 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698