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/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/wm/window_animations.h" | 9 #include "ash/wm/window_animations.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 login_window_(NULL), | 51 login_window_(NULL), |
52 login_view_(NULL), | 52 login_view_(NULL), |
53 webui_login_display_(NULL), | 53 webui_login_display_(NULL), |
54 is_showing_login_(false), | 54 is_showing_login_(false), |
55 is_wallpaper_loaded_(false), | 55 is_wallpaper_loaded_(false), |
56 crash_count_(0), | 56 crash_count_(0), |
57 restore_path_(RESTORE_UNKNOWN) { | 57 restore_path_(RESTORE_UNKNOWN) { |
58 bool is_registered = WizardController::IsDeviceRegistered(); | 58 bool is_registered = WizardController::IsDeviceRegistered(); |
59 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE. | 59 // TODO(nkostylev): Add switch to disable wallpaper transition on OOBE. |
60 // Should be used on test images so that they are not slowed down. | 60 // Should be used on test images so that they are not slowed down. |
61 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) | 61 bool zero_delay_enabled = WizardController::IsZeroDelayEnabled(); |
| 62 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe) && |
| 63 !zero_delay_enabled) { |
62 waiting_for_wallpaper_load_ = !is_registered; | 64 waiting_for_wallpaper_load_ = !is_registered; |
63 else | 65 } else { |
64 waiting_for_wallpaper_load_ = false; | 66 waiting_for_wallpaper_load_ = false; |
| 67 } |
65 | 68 |
66 if (waiting_for_wallpaper_load_) { | 69 if (waiting_for_wallpaper_load_) { |
67 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, | 70 registrar_.Add(this, chrome::NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, |
68 content::NotificationService::AllSources()); | 71 content::NotificationService::AllSources()); |
69 // Prevents white flashing on OOBE (http://crbug.com/131569). | 72 // Prevents white flashing on OOBE (http://crbug.com/131569). |
70 aura::Env::GetInstance()->set_render_white_bg(false); | 73 aura::Env::GetInstance()->set_render_white_bg(false); |
71 } | 74 } |
72 } | 75 } |
73 | 76 |
74 WebUILoginDisplayHost::~WebUILoginDisplayHost() { | 77 WebUILoginDisplayHost::~WebUILoginDisplayHost() { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 content::NotificationService::AllSources()); | 180 content::NotificationService::AllSources()); |
178 } | 181 } |
179 } | 182 } |
180 | 183 |
181 void WebUILoginDisplayHost::LoadURL(const GURL& url) { | 184 void WebUILoginDisplayHost::LoadURL(const GURL& url) { |
182 if (!login_window_) { | 185 if (!login_window_) { |
183 views::Widget::InitParams params( | 186 views::Widget::InitParams params( |
184 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); | 187 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); |
185 params.bounds = background_bounds(); | 188 params.bounds = background_bounds(); |
186 params.show_state = ui::SHOW_STATE_FULLSCREEN; | 189 params.show_state = ui::SHOW_STATE_FULLSCREEN; |
187 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableNewOobe)) | 190 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableNewOobe)) |
188 params.transparent = true; | 191 params.transparent = true; |
189 params.parent = | 192 params.parent = |
190 ash::Shell::GetContainer( | 193 ash::Shell::GetContainer( |
191 ash::Shell::GetPrimaryRootWindow(), | 194 ash::Shell::GetPrimaryRootWindow(), |
192 ash::internal::kShellWindowId_LockScreenContainer); | 195 ash::internal::kShellWindowId_LockScreenContainer); |
193 | 196 |
194 login_window_ = new views::Widget; | 197 login_window_ = new views::Widget; |
195 login_window_->Init(params); | 198 login_window_->Init(params); |
196 login_view_ = new WebUILoginView(); | 199 login_view_ = new WebUILoginView(); |
197 | 200 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 case RESTORE_SIGN_IN: | 284 case RESTORE_SIGN_IN: |
282 StartSignInScreen(); | 285 StartSignInScreen(); |
283 break; | 286 break; |
284 default: | 287 default: |
285 NOTREACHED(); | 288 NOTREACHED(); |
286 break; | 289 break; |
287 } | 290 } |
288 } | 291 } |
289 | 292 |
290 } // namespace chromeos | 293 } // namespace chromeos |
OLD | NEW |