| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/wizard_controller.h" | 5 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <signal.h> | 8 #include <signal.h> |
| 9 #include <sys/types.h> | 9 #include <sys/types.h> |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "app/l10n_util.h" | 14 #include "app/l10n_util.h" |
| 15 #include "base/command_line.h" | 15 #include "base/command_line.h" |
| 16 #include "base/logging.h" // For NOTREACHED. | 16 #include "base/logging.h" // For NOTREACHED. |
| 17 #include "chrome/browser/chromeos/cros/cros_library.h" | 17 #include "chrome/browser/chromeos/cros/cros_library.h" |
| 18 #include "chrome/browser/chromeos/cros/login_library.h" | 18 #include "chrome/browser/chromeos/cros/login_library.h" |
| 19 #include "chrome/browser/chromeos/customization_document.h" | 19 #include "chrome/browser/chromeos/customization_document.h" |
| 20 #include "chrome/browser/chromeos/login/account_screen.h" | 20 #include "chrome/browser/chromeos/login/account_screen.h" |
| 21 #include "chrome/browser/chromeos/login/background_view.h" | 21 #include "chrome/browser/chromeos/login/background_view.h" |
| 22 #include "chrome/browser/chromeos/login/existing_user_controller.h" | 22 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 23 #include "chrome/browser/chromeos/login/login_screen.h" | 23 #include "chrome/browser/chromeos/login/login_screen.h" |
| 24 #include "chrome/browser/chromeos/login/login_utils.h" | |
| 25 #include "chrome/browser/chromeos/login/network_screen.h" | 24 #include "chrome/browser/chromeos/login/network_screen.h" |
| 26 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" | 25 #include "chrome/browser/chromeos/login/rounded_rect_painter.h" |
| 27 #include "chrome/browser/chromeos/login/update_screen.h" | 26 #include "chrome/browser/chromeos/login/update_screen.h" |
| 28 #include "chrome/browser/chromeos/login/user_image_screen.h" | |
| 29 #include "chrome/browser/chromeos/login/user_manager.h" | 27 #include "chrome/browser/chromeos/login/user_manager.h" |
| 30 #include "chrome/browser/chromeos/wm_ipc.h" | 28 #include "chrome/browser/chromeos/wm_ipc.h" |
| 31 #include "chrome/browser/profile_manager.h" | |
| 32 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/notification_service.h" | 30 #include "chrome/common/notification_service.h" |
| 34 #include "third_party/cros/chromeos_wm_ipc_enums.h" | 31 #include "third_party/cros/chromeos_wm_ipc_enums.h" |
| 35 #include "views/accelerator.h" | 32 #include "views/accelerator.h" |
| 36 #include "views/painter.h" | 33 #include "views/painter.h" |
| 37 #include "views/screen.h" | 34 #include "views/screen.h" |
| 38 #include "views/view.h" | 35 #include "views/view.h" |
| 39 #include "views/widget/widget_gtk.h" | 36 #include "views/widget/widget_gtk.h" |
| 40 | 37 |
| 41 namespace { | 38 namespace { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 53 window_y_(window_y), | 50 window_y_(window_y), |
| 54 screen_w_(screen_w), | 51 screen_w_(screen_w), |
| 55 screen_h_(screen_h), | 52 screen_h_(screen_h), |
| 56 accel_account_screen_(views::Accelerator(base::VKEY_A, | 53 accel_account_screen_(views::Accelerator(base::VKEY_A, |
| 57 false, true, true)), | 54 false, true, true)), |
| 58 accel_login_screen_(views::Accelerator(base::VKEY_L, | 55 accel_login_screen_(views::Accelerator(base::VKEY_L, |
| 59 false, true, true)), | 56 false, true, true)), |
| 60 accel_network_screen_(views::Accelerator(base::VKEY_N, | 57 accel_network_screen_(views::Accelerator(base::VKEY_N, |
| 61 false, true, true)), | 58 false, true, true)), |
| 62 accel_update_screen_(views::Accelerator(base::VKEY_U, | 59 accel_update_screen_(views::Accelerator(base::VKEY_U, |
| 63 false, true, true)), | |
| 64 accel_image_screen_(views::Accelerator(base::VKEY_I, | |
| 65 false, true, true)) { | 60 false, true, true)) { |
| 66 if (paint_background) { | 61 if (paint_background) { |
| 67 painter_.reset(chromeos::CreateWizardPainter( | 62 painter_.reset(chromeos::CreateWizardPainter( |
| 68 &chromeos::BorderDefinition::kWizardBorder)); | 63 &chromeos::BorderDefinition::kWizardBorder)); |
| 69 } | 64 } |
| 70 | 65 |
| 71 AddAccelerator(accel_account_screen_); | 66 AddAccelerator(accel_account_screen_); |
| 72 AddAccelerator(accel_login_screen_); | 67 AddAccelerator(accel_login_screen_); |
| 73 AddAccelerator(accel_network_screen_); | 68 AddAccelerator(accel_network_screen_); |
| 74 AddAccelerator(accel_update_screen_); | 69 AddAccelerator(accel_update_screen_); |
| 75 AddAccelerator(accel_image_screen_); | |
| 76 } | 70 } |
| 77 | 71 |
| 78 ~ContentView() { | 72 ~ContentView() { |
| 79 NotificationService::current()->Notify( | 73 NotificationService::current()->Notify( |
| 80 NotificationType::WIZARD_CONTENT_VIEW_DESTROYED, | 74 NotificationType::WIZARD_CONTENT_VIEW_DESTROYED, |
| 81 NotificationService::AllSources(), | 75 NotificationService::AllSources(), |
| 82 NotificationService::NoDetails()); | 76 NotificationService::NoDetails()); |
| 83 } | 77 } |
| 84 | 78 |
| 85 bool AcceleratorPressed(const views::Accelerator& accel) { | 79 bool AcceleratorPressed(const views::Accelerator& accel) { |
| 86 WizardController* controller = WizardController::default_controller(); | 80 WizardController* controller = WizardController::default_controller(); |
| 87 if (!controller) | 81 if (!controller) |
| 88 return false; | 82 return false; |
| 89 | 83 |
| 90 if (accel == accel_account_screen_) { | 84 if (accel == accel_account_screen_) { |
| 91 controller->ShowAccountScreen(); | 85 controller->ShowAccountScreen(); |
| 92 } else if (accel == accel_login_screen_) { | 86 } else if (accel == accel_login_screen_) { |
| 93 controller->ShowLoginScreen(); | 87 controller->ShowLoginScreen(); |
| 94 } else if (accel == accel_network_screen_) { | 88 } else if (accel == accel_network_screen_) { |
| 95 controller->ShowNetworkScreen(); | 89 controller->ShowNetworkScreen(); |
| 96 } else if (accel == accel_update_screen_) { | 90 } else if (accel == accel_update_screen_) { |
| 97 controller->ShowUpdateScreen(); | 91 controller->ShowUpdateScreen(); |
| 98 } else if (accel == accel_image_screen_) { | |
| 99 controller->ShowUserImageScreen(); | |
| 100 } else { | 92 } else { |
| 101 return false; | 93 return false; |
| 102 } | 94 } |
| 103 | 95 |
| 104 return true; | 96 return true; |
| 105 } | 97 } |
| 106 | 98 |
| 107 void PaintBackground(gfx::Canvas* canvas) { | 99 void PaintBackground(gfx::Canvas* canvas) { |
| 108 if (painter_.get()) { | 100 if (painter_.get()) { |
| 109 // TODO(sky): nuke this once new login manager is in place. This needs to | 101 // TODO(sky): nuke this once new login manager is in place. This needs to |
| (...skipping 17 matching lines...) Expand all Loading... |
| 127 | 119 |
| 128 const int window_x_; | 120 const int window_x_; |
| 129 const int window_y_; | 121 const int window_y_; |
| 130 const int screen_w_; | 122 const int screen_w_; |
| 131 const int screen_h_; | 123 const int screen_h_; |
| 132 | 124 |
| 133 views::Accelerator accel_account_screen_; | 125 views::Accelerator accel_account_screen_; |
| 134 views::Accelerator accel_login_screen_; | 126 views::Accelerator accel_login_screen_; |
| 135 views::Accelerator accel_network_screen_; | 127 views::Accelerator accel_network_screen_; |
| 136 views::Accelerator accel_update_screen_; | 128 views::Accelerator accel_update_screen_; |
| 137 views::Accelerator accel_image_screen_; | |
| 138 | 129 |
| 139 DISALLOW_COPY_AND_ASSIGN(ContentView); | 130 DISALLOW_COPY_AND_ASSIGN(ContentView); |
| 140 }; | 131 }; |
| 141 | 132 |
| 142 | 133 |
| 143 // Returns bounds of the screen to use for login wizard. | 134 // Returns bounds of the screen to use for login wizard. |
| 144 // The rect is centered within the default monitor and sized accordingly if | 135 // The rect is centered within the default monitor and sized accordingly if |
| 145 // |size| is not empty. Otherwise the whole monitor is occupied. | 136 // |size| is not empty. Otherwise the whole monitor is occupied. |
| 146 gfx::Rect CalculateScreenBounds(const gfx::Size& size) { | 137 gfx::Rect CalculateScreenBounds(const gfx::Size& size) { |
| 147 gfx::Rect bounds(views::Screen::GetMonitorWorkAreaNearestWindow(NULL)); | 138 gfx::Rect bounds(views::Screen::GetMonitorWorkAreaNearestWindow(NULL)); |
| 148 if (!size.IsEmpty()) { | 139 if (!size.IsEmpty()) { |
| 149 int horizontal_diff = bounds.width() - size.width(); | 140 int horizontal_diff = bounds.width() - size.width(); |
| 150 int vertical_diff = bounds.height() - size.height(); | 141 int vertical_diff = bounds.height() - size.height(); |
| 151 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); | 142 bounds.Inset(horizontal_diff / 2, vertical_diff / 2); |
| 152 } | 143 } |
| 153 | 144 |
| 154 return bounds; | 145 return bounds; |
| 155 } | 146 } |
| 156 | 147 |
| 157 } // namespace | 148 } // namespace |
| 158 | 149 |
| 159 const char WizardController::kNetworkScreenName[] = "network"; | 150 const char WizardController::kNetworkScreenName[] = "network"; |
| 160 const char WizardController::kLoginScreenName[] = "login"; | 151 const char WizardController::kLoginScreenName[] = "login"; |
| 161 const char WizardController::kAccountScreenName[] = "account"; | 152 const char WizardController::kAccountScreenName[] = "account"; |
| 162 const char WizardController::kUpdateScreenName[] = "update"; | 153 const char WizardController::kUpdateScreenName[] = "update"; |
| 163 const char WizardController::kUserImageScreenName[] = "image"; | |
| 164 | 154 |
| 165 // Passing this parameter as a "first screen" initiates full OOBE flow. | 155 // Passing this parameter as a "first screen" initiates full OOBE flow. |
| 166 const char WizardController::kOutOfBoxScreenName[] = "oobe"; | 156 const char WizardController::kOutOfBoxScreenName[] = "oobe"; |
| 167 | 157 |
| 168 // Special test value that commands not to create any window yet. | 158 // Special test value that commands not to create any window yet. |
| 169 const char WizardController::kTestNoScreenName[] = "test:nowindow"; | 159 const char WizardController::kTestNoScreenName[] = "test:nowindow"; |
| 170 | 160 |
| 171 // Initialize default controller. | 161 // Initialize default controller. |
| 172 // static | 162 // static |
| 173 WizardController* WizardController::default_controller_ = NULL; | 163 WizardController* WizardController::default_controller_ = NULL; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 188 } | 178 } |
| 189 | 179 |
| 190 WizardController::~WizardController() { | 180 WizardController::~WizardController() { |
| 191 // Close ends up deleting the widget. | 181 // Close ends up deleting the widget. |
| 192 if (background_widget_) | 182 if (background_widget_) |
| 193 background_widget_->Close(); | 183 background_widget_->Close(); |
| 194 | 184 |
| 195 if (widget_) | 185 if (widget_) |
| 196 widget_->Close(); | 186 widget_->Close(); |
| 197 | 187 |
| 198 // Complete login. | |
| 199 chromeos::LoginUtils::Get()->EnableBrowserLaunch(true); | |
| 200 ChromeThread::PostTask( | |
| 201 ChromeThread::UI, | |
| 202 FROM_HERE, | |
| 203 NewRunnableFunction(&chromeos::LoginUtils::DoBrowserLaunch, | |
| 204 ProfileManager::GetDefaultProfile())); | |
| 205 | |
| 206 default_controller_ = NULL; | 188 default_controller_ = NULL; |
| 207 } | 189 } |
| 208 | 190 |
| 209 void WizardController::Init(const std::string& first_screen_name, | 191 void WizardController::Init(const std::string& first_screen_name, |
| 210 const gfx::Rect& screen_bounds, | 192 const gfx::Rect& screen_bounds, |
| 211 bool paint_background) { | 193 bool paint_background) { |
| 212 DCHECK(!contents_); | 194 DCHECK(!contents_); |
| 213 | 195 |
| 214 int offset_x = (screen_bounds.width() - kWizardScreenWidth) / 2; | 196 int offset_x = (screen_bounds.width() - kWizardScreenWidth) / 2; |
| 215 int offset_y = (screen_bounds.height() - kWizardScreenHeight) / 2; | 197 int offset_y = (screen_bounds.height() - kWizardScreenHeight) / 2; |
| 216 int window_x = screen_bounds.x() + offset_x; | 198 int window_x = screen_bounds.x() + offset_x; |
| 217 int window_y = screen_bounds.y() + offset_y; | 199 int window_y = screen_bounds.y() + offset_y; |
| 218 | 200 |
| 219 contents_ = new ContentView(paint_background, | 201 contents_ = new ContentView(paint_background, |
| 220 offset_x, offset_y, | 202 offset_x, offset_y, |
| 221 screen_bounds.width(), screen_bounds.height()); | 203 screen_bounds.width(), screen_bounds.height()); |
| 222 | 204 |
| 223 views::WidgetGtk* window = | 205 views::WidgetGtk* window = |
| 224 new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW); | 206 new views::WidgetGtk(views::WidgetGtk::TYPE_WINDOW); |
| 225 widget_ = window; | 207 widget_ = window; |
| 226 if (!paint_background) { | 208 if (!paint_background) |
| 227 window->MakeTransparent(); | 209 window->MakeTransparent(); |
| 228 // Window transparency makes background flicker through controls that | |
| 229 // are constantly updating its contents (like image view with video | |
| 230 // stream). Hence enabling double buffer. | |
| 231 window->EnableDoubleBuffer(true); | |
| 232 } | |
| 233 window->Init(NULL, gfx::Rect(window_x, window_y, kWizardScreenWidth, | 210 window->Init(NULL, gfx::Rect(window_x, window_y, kWizardScreenWidth, |
| 234 kWizardScreenHeight)); | 211 kWizardScreenHeight)); |
| 235 chromeos::WmIpc::instance()->SetWindowType( | 212 chromeos::WmIpc::instance()->SetWindowType( |
| 236 window->GetNativeView(), | 213 window->GetNativeView(), |
| 237 chromeos::WM_IPC_WINDOW_LOGIN_GUEST, | 214 chromeos::WM_IPC_WINDOW_LOGIN_GUEST, |
| 238 NULL); | 215 NULL); |
| 239 window->SetContentsView(contents_); | 216 window->SetContentsView(contents_); |
| 240 | 217 |
| 241 if (chromeos::UserManager::Get()->GetUsers().empty() || | 218 if (chromeos::UserManager::Get()->GetUsers().empty() || |
| 242 first_screen_name == kOutOfBoxScreenName) { | 219 first_screen_name == kOutOfBoxScreenName) { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 account_screen_.reset(new chromeos::AccountScreen(this)); | 265 account_screen_.reset(new chromeos::AccountScreen(this)); |
| 289 return account_screen_.get(); | 266 return account_screen_.get(); |
| 290 } | 267 } |
| 291 | 268 |
| 292 chromeos::UpdateScreen* WizardController::GetUpdateScreen() { | 269 chromeos::UpdateScreen* WizardController::GetUpdateScreen() { |
| 293 if (!update_screen_.get()) | 270 if (!update_screen_.get()) |
| 294 update_screen_.reset(new chromeos::UpdateScreen(this)); | 271 update_screen_.reset(new chromeos::UpdateScreen(this)); |
| 295 return update_screen_.get(); | 272 return update_screen_.get(); |
| 296 } | 273 } |
| 297 | 274 |
| 298 chromeos::UserImageScreen* WizardController::GetUserImageScreen() { | |
| 299 if (!user_image_screen_.get()) | |
| 300 user_image_screen_.reset(new chromeos::UserImageScreen(this)); | |
| 301 return user_image_screen_.get(); | |
| 302 } | |
| 303 | |
| 304 void WizardController::ShowNetworkScreen() { | 275 void WizardController::ShowNetworkScreen() { |
| 305 SetStatusAreaVisible(false); | 276 SetStatusAreaVisible(false); |
| 306 SetCurrentScreen(GetNetworkScreen()); | 277 SetCurrentScreen(GetNetworkScreen()); |
| 307 } | 278 } |
| 308 | 279 |
| 309 void WizardController::ShowLoginScreen() { | 280 void WizardController::ShowLoginScreen() { |
| 310 SetStatusAreaVisible(true); | 281 SetStatusAreaVisible(true); |
| 311 SetCurrentScreen(GetLoginScreen()); | 282 SetCurrentScreen(GetLoginScreen()); |
| 312 } | 283 } |
| 313 | 284 |
| 314 void WizardController::ShowAccountScreen() { | 285 void WizardController::ShowAccountScreen() { |
| 315 SetStatusAreaVisible(true); | 286 SetStatusAreaVisible(true); |
| 316 SetCurrentScreen(GetAccountScreen()); | 287 SetCurrentScreen(GetAccountScreen()); |
| 317 } | 288 } |
| 318 | 289 |
| 319 void WizardController::ShowUpdateScreen() { | 290 void WizardController::ShowUpdateScreen() { |
| 320 SetStatusAreaVisible(true); | 291 SetStatusAreaVisible(true); |
| 321 SetCurrentScreen(GetUpdateScreen()); | 292 SetCurrentScreen(GetUpdateScreen()); |
| 322 } | 293 } |
| 323 | 294 |
| 324 void WizardController::ShowUserImageScreen() { | |
| 325 SetStatusAreaVisible(true); | |
| 326 SetCurrentScreen(GetUserImageScreen()); | |
| 327 } | |
| 328 | |
| 329 void WizardController::SetStatusAreaVisible(bool visible) { | 295 void WizardController::SetStatusAreaVisible(bool visible) { |
| 330 // When ExistingUserController passes background ownership | 296 // When ExistingUserController passes background ownership |
| 331 // to WizardController it happens after screen is shown. | 297 // to WizardController it happens after screen is shown. |
| 332 if (background_view_) { | 298 if (background_view_) { |
| 333 background_view_->SetStatusAreaVisible(visible); | 299 background_view_->SetStatusAreaVisible(visible); |
| 334 } | 300 } |
| 335 } | 301 } |
| 336 | 302 |
| 337 void WizardController::SetCustomization( | 303 void WizardController::SetCustomization( |
| 338 const chromeos::StartupCustomizationDocument* customization) { | 304 const chromeos::StartupCustomizationDocument* customization) { |
| 339 customization_.reset(customization); | 305 customization_.reset(customization); |
| 340 } | 306 } |
| 341 | 307 |
| 342 /////////////////////////////////////////////////////////////////////////////// | 308 /////////////////////////////////////////////////////////////////////////////// |
| 343 // WizardController, ExitHandlers: | 309 // WizardController, ExitHandlers: |
| 344 void WizardController::OnLoginSignInSelected() { | 310 void WizardController::OnLoginSignInSelected() { |
| 345 // Don't launch browser until we pass image screen. | 311 // We're on the stack, so don't try and delete us now. |
| 346 chromeos::LoginUtils::Get()->EnableBrowserLaunch(false); | 312 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 347 ShowUserImageScreen(); | |
| 348 } | 313 } |
| 349 | 314 |
| 350 void WizardController::OnLoginCreateAccount() { | 315 void WizardController::OnLoginCreateAccount() { |
| 351 ShowAccountScreen(); | 316 ShowAccountScreen(); |
| 352 } | 317 } |
| 353 | 318 |
| 354 void WizardController::OnNetworkConnected() { | 319 void WizardController::OnNetworkConnected() { |
| 355 if (is_out_of_box_) { | 320 if (is_out_of_box_) { |
| 356 ShowUpdateScreen(); | 321 ShowUpdateScreen(); |
| 357 GetUpdateScreen()->StartUpdate(); | 322 GetUpdateScreen()->StartUpdate(); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 ShowLoginScreen(); | 368 ShowLoginScreen(); |
| 404 } | 369 } |
| 405 | 370 |
| 406 void WizardController::OnUpdateErrorUpdating() { | 371 void WizardController::OnUpdateErrorUpdating() { |
| 407 // If there was an error while getting or applying the update, | 372 // If there was an error while getting or applying the update, |
| 408 // return to network selection screen. | 373 // return to network selection screen. |
| 409 // TODO(nkostylev): Show message to the user explaining update error. | 374 // TODO(nkostylev): Show message to the user explaining update error. |
| 410 ShowNetworkScreen(); | 375 ShowNetworkScreen(); |
| 411 } | 376 } |
| 412 | 377 |
| 413 void WizardController::OnUserImageSelected() { | |
| 414 // We're on the stack, so don't try and delete us now. | |
| 415 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | |
| 416 // TODO(avayvod): Sync image with Google Sync. | |
| 417 } | |
| 418 | |
| 419 void WizardController::OnUserImageSkipped() { | |
| 420 OnUserImageSelected(); | |
| 421 } | |
| 422 | |
| 423 /////////////////////////////////////////////////////////////////////////////// | 378 /////////////////////////////////////////////////////////////////////////////// |
| 424 // WizardController, private: | 379 // WizardController, private: |
| 425 | 380 |
| 426 void WizardController::SetCurrentScreen(WizardScreen* new_current) { | 381 void WizardController::SetCurrentScreen(WizardScreen* new_current) { |
| 427 if (current_screen_ == new_current) | 382 if (current_screen_ == new_current) |
| 428 return; | 383 return; |
| 429 if (current_screen_) | 384 if (current_screen_) |
| 430 current_screen_->Hide(); | 385 current_screen_->Hide(); |
| 431 current_screen_ = new_current; | 386 current_screen_ = new_current; |
| 432 if (current_screen_) { | 387 if (current_screen_) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 445 void WizardController::ShowFirstScreen(const std::string& first_screen_name) { | 400 void WizardController::ShowFirstScreen(const std::string& first_screen_name) { |
| 446 if (first_screen_name == kNetworkScreenName) { | 401 if (first_screen_name == kNetworkScreenName) { |
| 447 ShowNetworkScreen(); | 402 ShowNetworkScreen(); |
| 448 } else if (first_screen_name == kLoginScreenName) { | 403 } else if (first_screen_name == kLoginScreenName) { |
| 449 ShowLoginScreen(); | 404 ShowLoginScreen(); |
| 450 } else if (first_screen_name == kAccountScreenName) { | 405 } else if (first_screen_name == kAccountScreenName) { |
| 451 ShowAccountScreen(); | 406 ShowAccountScreen(); |
| 452 } else if (first_screen_name == kUpdateScreenName) { | 407 } else if (first_screen_name == kUpdateScreenName) { |
| 453 ShowUpdateScreen(); | 408 ShowUpdateScreen(); |
| 454 GetUpdateScreen()->StartUpdate(); | 409 GetUpdateScreen()->StartUpdate(); |
| 455 } else if (first_screen_name == kUserImageScreenName) { | |
| 456 ShowUserImageScreen(); | |
| 457 } else if (first_screen_name != kTestNoScreenName) { | 410 } else if (first_screen_name != kTestNoScreenName) { |
| 458 if (is_out_of_box_) { | 411 if (is_out_of_box_) { |
| 459 ShowNetworkScreen(); | 412 ShowNetworkScreen(); |
| 460 } else { | 413 } else { |
| 461 ShowLoginScreen(); | 414 ShowLoginScreen(); |
| 462 } | 415 } |
| 463 } | 416 } |
| 464 } | 417 } |
| 465 | 418 |
| 466 /////////////////////////////////////////////////////////////////////////////// | 419 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 25 matching lines...) Expand all Loading... |
| 492 case UPDATE_INSTALLED: | 445 case UPDATE_INSTALLED: |
| 493 case UPDATE_NOUPDATE: | 446 case UPDATE_NOUPDATE: |
| 494 OnUpdateCompleted(); | 447 OnUpdateCompleted(); |
| 495 break; | 448 break; |
| 496 case UPDATE_ERROR_CHECKING_FOR_UPDATE: | 449 case UPDATE_ERROR_CHECKING_FOR_UPDATE: |
| 497 OnUpdateErrorCheckingForUpdate(); | 450 OnUpdateErrorCheckingForUpdate(); |
| 498 break; | 451 break; |
| 499 case UPDATE_ERROR_UPDATING: | 452 case UPDATE_ERROR_UPDATING: |
| 500 OnUpdateErrorUpdating(); | 453 OnUpdateErrorUpdating(); |
| 501 break; | 454 break; |
| 502 case USER_IMAGE_SELECTED: | |
| 503 OnUserImageSelected(); | |
| 504 break; | |
| 505 case USER_IMAGE_SKIPPED: | |
| 506 OnUserImageSkipped(); | |
| 507 break; | |
| 508 default: | 455 default: |
| 509 NOTREACHED(); | 456 NOTREACHED(); |
| 510 } | 457 } |
| 511 } | 458 } |
| 512 | 459 |
| 513 /////////////////////////////////////////////////////////////////////////////// | 460 /////////////////////////////////////////////////////////////////////////////// |
| 514 // WizardController, WizardScreen overrides: | 461 // WizardController, WizardScreen overrides: |
| 515 views::View* WizardController::GetWizardView() { | 462 views::View* WizardController::GetWizardView() { |
| 516 return contents_; | 463 return contents_; |
| 517 } | 464 } |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 561 WizardController* controller = new WizardController(); | 508 WizardController* controller = new WizardController(); |
| 562 controller->SetCustomization(customization.release()); | 509 controller->SetCustomization(customization.release()); |
| 563 controller->ShowBackground(screen_bounds); | 510 controller->ShowBackground(screen_bounds); |
| 564 controller->Init(first_screen_name, screen_bounds, true); | 511 controller->Init(first_screen_name, screen_bounds, true); |
| 565 controller->Show(); | 512 controller->Show(); |
| 566 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) | 513 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) |
| 567 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); | 514 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); |
| 568 } | 515 } |
| 569 | 516 |
| 570 } // namespace browser | 517 } // namespace browser |
| OLD | NEW |