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/desktop_background/desktop_background_controller.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/shell_window_ids.h" | 9 #include "ash/shell_window_ids.h" |
10 #include "ash/wm/window_animations.h" | 10 #include "ash/wm/window_animations.h" |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 login_window_(NULL), | 62 login_window_(NULL), |
63 login_view_(NULL), | 63 login_view_(NULL), |
64 webui_login_display_(NULL), | 64 webui_login_display_(NULL), |
65 is_showing_login_(false), | 65 is_showing_login_(false), |
66 is_wallpaper_loaded_(false), | 66 is_wallpaper_loaded_(false), |
67 initialize_webui_in_parallel_(kInitializeWebUIInParallelDefault), | 67 initialize_webui_in_parallel_(kInitializeWebUIInParallelDefault), |
68 status_area_saved_visibility_(false), | 68 status_area_saved_visibility_(false), |
69 crash_count_(0), | 69 crash_count_(0), |
70 restore_path_(RESTORE_UNKNOWN) { | 70 restore_path_(RESTORE_UNKNOWN) { |
71 bool is_registered = WizardController::IsDeviceRegistered(); | 71 bool is_registered = WizardController::IsDeviceRegistered(); |
72 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE. | |
73 // Should be used on test images so that they are not slowed down. | |
74 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); | 72 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
75 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe) && | 73 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe) && |
76 !zero_delay_enabled) { | 74 !zero_delay_enabled) { |
77 bool disable_boot_animation = CommandLine::ForCurrentProcess()-> | 75 bool disable_boot_animation = CommandLine::ForCurrentProcess()-> |
78 HasSwitch(switches::kDisableBootAnimation); | 76 HasSwitch(switches::kDisableBootAnimation); |
79 waiting_for_wallpaper_load_ = !is_registered || !disable_boot_animation; | 77 waiting_for_wallpaper_load_ = !is_registered || !disable_boot_animation; |
80 } else { | 78 } else { |
81 waiting_for_wallpaper_load_ = false; | 79 waiting_for_wallpaper_load_ = false; |
82 } | 80 } |
83 | 81 |
84 if (waiting_for_wallpaper_load_) { | 82 if (waiting_for_wallpaper_load_) { |
85 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 83 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
86 content::NotificationService::AllSources()); | 84 content::NotificationService::AllSources()); |
87 // Prevents white flashing on OOBE (http://crbug.com/131569). | 85 // Prevents white flashing on OOBE (http://crbug.com/131569). |
88 aura::Env::GetInstance()->set_render_white_bg(false); | 86 aura::Env::GetInstance()->set_render_white_bg(false); |
89 | 87 |
90 // Check if WebUI init type is overriden. | 88 // Check if WebUI init type is overriden. |
91 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshWebUIInit)) { | 89 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshWebUIInit)) { |
92 const std::string override_type = CommandLine::ForCurrentProcess()-> | 90 const std::string override_type = CommandLine::ForCurrentProcess()-> |
93 GetSwitchValueASCII(switches::kAshWebUIInit); | 91 GetSwitchValueASCII(switches::kAshWebUIInit); |
94 if (override_type == kWebUIInitParallel) | 92 if (override_type == kWebUIInitParallel) |
95 initialize_webui_in_parallel_ = true; | 93 initialize_webui_in_parallel_ = true; |
96 else if (override_type == kWebUIInitPostpone) | 94 else if (override_type == kWebUIInitPostpone) |
97 initialize_webui_in_parallel_ = false; | 95 initialize_webui_in_parallel_ = false; |
98 } | 96 } |
| 97 |
| 98 // Don't postpone WebUI initialization on first boot, otherwise we miss |
| 99 // initial animation. |
| 100 if (!WizardController::IsOobeCompleted()) |
| 101 initialize_webui_in_parallel_ = false; |
99 } | 102 } |
100 // In case if we're not waiting for wallpaper load, | 103 // In case if we're not waiting for wallpaper load, |
101 // |initialize_webui_in_parallel_| value is ignored through the code flow. | 104 // |initialize_webui_in_parallel_| value is ignored through the code flow. |
102 } | 105 } |
103 | 106 |
104 WebUILoginDisplayHost::~WebUILoginDisplayHost() { | 107 WebUILoginDisplayHost::~WebUILoginDisplayHost() { |
105 if (login_window_) | 108 if (login_window_) |
106 login_window_->Close(); | 109 login_window_->Close(); |
107 } | 110 } |
108 | 111 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 case RESTORE_SIGN_IN: | 342 case RESTORE_SIGN_IN: |
340 StartSignInScreen(); | 343 StartSignInScreen(); |
341 break; | 344 break; |
342 default: | 345 default: |
343 NOTREACHED(); | 346 NOTREACHED(); |
344 break; | 347 break; |
345 } | 348 } |
346 } | 349 } |
347 | 350 |
348 } // namespace chromeos | 351 } // namespace chromeos |
OLD | NEW |