OLD | NEW |
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 Loading... |
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 = CommandLine::ForCurrentProcess()-> |
| 66 HasSwitch(switches::kDisableBootAnimation); |
| 67 waiting_for_wallpaper_load_ = !is_registered || !disable_boot_animation; |
65 } else { | 68 } else { |
66 waiting_for_wallpaper_load_ = false; | 69 waiting_for_wallpaper_load_ = false; |
67 } | 70 } |
68 | 71 |
69 if (waiting_for_wallpaper_load_) { | 72 if (waiting_for_wallpaper_load_) { |
70 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 73 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
71 content::NotificationService::AllSources()); | 74 content::NotificationService::AllSources()); |
72 // Prevents white flashing on OOBE (http://crbug.com/131569). | 75 // Prevents white flashing on OOBE (http://crbug.com/131569). |
73 aura::Env::GetInstance()->set_render_white_bg(false); | 76 aura::Env::GetInstance()->set_render_white_bg(false); |
74 } | 77 } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 } | 169 } |
167 } | 170 } |
168 | 171 |
169 void WebUILoginDisplayHost::Observe( | 172 void WebUILoginDisplayHost::Observe( |
170 int type, | 173 int type, |
171 const content::NotificationSource& source, | 174 const content::NotificationSource& source, |
172 const content::NotificationDetails& details) { | 175 const content::NotificationDetails& details) { |
173 BaseLoginDisplayHost::Observe(type, source, details); | 176 BaseLoginDisplayHost::Observe(type, source, details); |
174 if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { | 177 if (chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED == type) { |
175 is_wallpaper_loaded_ = true; | 178 is_wallpaper_loaded_ = true; |
| 179 ash::Shell::GetInstance()->user_wallpaper_delegate()-> |
| 180 OnWallpaperBootAnimationFinished(); |
176 if (waiting_for_wallpaper_load_) | 181 if (waiting_for_wallpaper_load_) |
177 StartPostponedWebUI(); | 182 StartPostponedWebUI(); |
178 registrar_.Remove(this, | 183 registrar_.Remove(this, |
179 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 184 chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
180 content::NotificationService::AllSources()); | 185 content::NotificationService::AllSources()); |
181 } | 186 } |
182 } | 187 } |
183 | 188 |
184 void WebUILoginDisplayHost::LoadURL(const GURL& url) { | 189 void WebUILoginDisplayHost::LoadURL(const GURL& url) { |
185 if (!login_window_) { | 190 if (!login_window_) { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 case RESTORE_SIGN_IN: | 289 case RESTORE_SIGN_IN: |
285 StartSignInScreen(); | 290 StartSignInScreen(); |
286 break; | 291 break; |
287 default: | 292 default: |
288 NOTREACHED(); | 293 NOTREACHED(); |
289 break; | 294 break; |
290 } | 295 } |
291 } | 296 } |
292 | 297 |
293 } // namespace chromeos | 298 } // namespace chromeos |
OLD | NEW |