| 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 |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 chromeos::ScreenObserver* WizardController::GetObserver(WizardScreen* screen) { | 447 chromeos::ScreenObserver* WizardController::GetObserver(WizardScreen* screen) { |
| 448 return observer_ ? observer_ : this; | 448 return observer_ ? observer_ : this; |
| 449 } | 449 } |
| 450 | 450 |
| 451 namespace browser { | 451 namespace browser { |
| 452 | 452 |
| 453 // Declared in browser_dialogs.h so that others don't need to depend on our .h. | 453 // Declared in browser_dialogs.h so that others don't need to depend on our .h. |
| 454 void ShowLoginWizard(const std::string& first_screen_name, | 454 void ShowLoginWizard(const std::string& first_screen_name, |
| 455 const gfx::Size& size) { | 455 const gfx::Size& size) { |
| 456 LOG(INFO) << "showing login" << first_screen_name; | 456 LOG(INFO) << "showing login" << first_screen_name; |
| 457 |
| 458 // Tell the window manager that the user isn't logged in. |
| 459 chromeos::WmIpc::instance()->SetLoggedInProperty(false); |
| 460 |
| 457 gfx::Rect screen_bounds(CalculateScreenBounds(size)); | 461 gfx::Rect screen_bounds(CalculateScreenBounds(size)); |
| 458 | 462 |
| 459 if (first_screen_name.empty() && | 463 if (first_screen_name.empty() && |
| 460 chromeos::CrosLibrary::Get()->EnsureLoaded() && | 464 chromeos::CrosLibrary::Get()->EnsureLoaded() && |
| 461 CommandLine::ForCurrentProcess()->HasSwitch( | 465 CommandLine::ForCurrentProcess()->HasSwitch( |
| 462 switches::kEnableLoginImages)) { | 466 switches::kEnableLoginImages)) { |
| 463 std::vector<chromeos::UserManager::User> users = | 467 std::vector<chromeos::UserManager::User> users = |
| 464 chromeos::UserManager::Get()->GetUsers(); | 468 chromeos::UserManager::Get()->GetUsers(); |
| 465 if (!users.empty()) { | 469 if (!users.empty()) { |
| 466 // ExistingUserController deletes itself. | 470 // ExistingUserController deletes itself. |
| 467 (new chromeos::ExistingUserController(users, screen_bounds))->Init(); | 471 (new chromeos::ExistingUserController(users, screen_bounds))->Init(); |
| 468 return; | 472 return; |
| 469 } | 473 } |
| 470 } | 474 } |
| 471 | 475 |
| 472 WizardController* controller = new WizardController(); | 476 WizardController* controller = new WizardController(); |
| 473 controller->ShowBackground(screen_bounds); | 477 controller->ShowBackground(screen_bounds); |
| 474 controller->Init(first_screen_name, screen_bounds, true); | 478 controller->Init(first_screen_name, screen_bounds, true); |
| 475 controller->Show(); | 479 controller->Show(); |
| 476 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) | 480 if (chromeos::CrosLibrary::Get()->EnsureLoaded()) |
| 477 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); | 481 chromeos::CrosLibrary::Get()->GetLoginLibrary()->EmitLoginPromptReady(); |
| 478 } | 482 } |
| 479 | 483 |
| 480 } // namespace browser | 484 } // namespace browser |
| OLD | NEW |