| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/login_display_host_impl.h" | 5 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/audio/sounds.h" | 9 #include "ash/audio/sounds.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 ResetKeyboardOverscrollOverride(); | 418 ResetKeyboardOverscrollOverride(); |
| 419 | 419 |
| 420 views::FocusManager::set_arrow_key_traversal_enabled(false); | 420 views::FocusManager::set_arrow_key_traversal_enabled(false); |
| 421 ResetLoginWindowAndView(); | 421 ResetLoginWindowAndView(); |
| 422 | 422 |
| 423 // Let chrome process exit after login/oobe screen if needed. | 423 // Let chrome process exit after login/oobe screen if needed. |
| 424 chrome::DecrementKeepAliveCount(); | 424 chrome::DecrementKeepAliveCount(); |
| 425 | 425 |
| 426 default_host_ = NULL; | 426 default_host_ = NULL; |
| 427 // TODO(tengs): This should be refactored. See crbug.com/314934. | 427 // TODO(tengs): This should be refactored. See crbug.com/314934. |
| 428 if (UserManager::Get()->IsCurrentUserNew()) { | 428 if (GetUserManager()->IsCurrentUserNew()) { |
| 429 // DriveOptInController will delete itself when finished. | 429 // DriveOptInController will delete itself when finished. |
| 430 (new DriveFirstRunController( | 430 (new DriveFirstRunController( |
| 431 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); | 431 ProfileManager::GetActiveUserProfile()))->EnableOfflineMode(); |
| 432 } | 432 } |
| 433 } | 433 } |
| 434 | 434 |
| 435 //////////////////////////////////////////////////////////////////////////////// | 435 //////////////////////////////////////////////////////////////////////////////// |
| 436 // LoginDisplayHostImpl, LoginDisplayHost implementation: | 436 // LoginDisplayHostImpl, LoginDisplayHost implementation: |
| 437 | 437 |
| 438 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( | 438 LoginDisplay* LoginDisplayHostImpl::CreateLoginDisplay( |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 lock_container->layer()->SetOpacity(1.0); | 578 lock_container->layer()->SetOpacity(1.0); |
| 579 | 579 |
| 580 ash::Shell::GetInstance()-> | 580 ash::Shell::GetInstance()-> |
| 581 desktop_background_controller()->MoveDesktopToLockedContainer(); | 581 desktop_background_controller()->MoveDesktopToLockedContainer(); |
| 582 | 582 |
| 583 sign_in_controller_.reset(); // Only one controller in a time. | 583 sign_in_controller_.reset(); // Only one controller in a time. |
| 584 sign_in_controller_.reset(new chromeos::ExistingUserController(this)); | 584 sign_in_controller_.reset(new chromeos::ExistingUserController(this)); |
| 585 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); | 585 SetOobeProgressBarVisible(oobe_progress_bar_visible_ = false); |
| 586 SetStatusAreaVisible(true); | 586 SetStatusAreaVisible(true); |
| 587 sign_in_controller_->Init( | 587 sign_in_controller_->Init( |
| 588 chromeos::UserManager::Get()->GetUsersAdmittedForMultiProfile()); | 588 chromeos::GetUserManager()->GetUsersAdmittedForMultiProfile()); |
| 589 CHECK(webui_login_display_); | 589 CHECK(webui_login_display_); |
| 590 GetOobeUI()->ShowSigninScreen(LoginScreenContext(), | 590 GetOobeUI()->ShowSigninScreen(LoginScreenContext(), |
| 591 webui_login_display_, | 591 webui_login_display_, |
| 592 webui_login_display_); | 592 webui_login_display_); |
| 593 } | 593 } |
| 594 | 594 |
| 595 void LoginDisplayHostImpl::StartSignInScreen( | 595 void LoginDisplayHostImpl::StartSignInScreen( |
| 596 const LoginScreenContext& context) { | 596 const LoginScreenContext& context) { |
| 597 if (login::LoginScrollIntoViewEnabled()) | 597 if (login::LoginScrollIntoViewEnabled()) |
| 598 DisableKeyboardOverscroll(); | 598 DisableKeyboardOverscroll(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 614 | 614 |
| 615 if (!login_window_) { | 615 if (!login_window_) { |
| 616 TRACE_EVENT_ASYNC_BEGIN0("ui", "ShowLoginWebUI", kShowLoginWebUIid); | 616 TRACE_EVENT_ASYNC_BEGIN0("ui", "ShowLoginWebUI", kShowLoginWebUIid); |
| 617 TRACE_EVENT_ASYNC_STEP_INTO0( | 617 TRACE_EVENT_ASYNC_STEP_INTO0( |
| 618 "ui", "ShowLoginWebUI", kShowLoginWebUIid, "StartSignInScreen"); | 618 "ui", "ShowLoginWebUI", kShowLoginWebUIid, "StartSignInScreen"); |
| 619 BootTimesLoader::Get()->RecordCurrentStats("login-start-signin-screen"); | 619 BootTimesLoader::Get()->RecordCurrentStats("login-start-signin-screen"); |
| 620 LoadURL(GURL(kLoginURL)); | 620 LoadURL(GURL(kLoginURL)); |
| 621 } | 621 } |
| 622 | 622 |
| 623 DVLOG(1) << "Starting sign in screen"; | 623 DVLOG(1) << "Starting sign in screen"; |
| 624 const chromeos::UserList& users = chromeos::UserManager::Get()->GetUsers(); | 624 const chromeos::UserList& users = chromeos::GetUserManager()->GetUsers(); |
| 625 | 625 |
| 626 // Fix for users who updated device and thus never passed register screen. | 626 // Fix for users who updated device and thus never passed register screen. |
| 627 // If we already have users, we assume that it is not a second part of | 627 // If we already have users, we assume that it is not a second part of |
| 628 // OOBE. See http://crosbug.com/6289 | 628 // OOBE. See http://crosbug.com/6289 |
| 629 if (!StartupUtils::IsDeviceRegistered() && !users.empty()) { | 629 if (!StartupUtils::IsDeviceRegistered() && !users.empty()) { |
| 630 VLOG(1) << "Mark device registered because there are remembered users: " | 630 VLOG(1) << "Mark device registered because there are remembered users: " |
| 631 << users.size(); | 631 << users.size(); |
| 632 StartupUtils::MarkDeviceRegistered(base::Closure()); | 632 StartupUtils::MarkDeviceRegistered(base::Closure()); |
| 633 } | 633 } |
| 634 | 634 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 786 // Browsers created before session start (windows opened by extensions, for | 786 // Browsers created before session start (windows opened by extensions, for |
| 787 // example) are ignored. | 787 // example) are ignored. |
| 788 OnBrowserCreated(); | 788 OnBrowserCreated(); |
| 789 registrar_.Remove(this, | 789 registrar_.Remove(this, |
| 790 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, | 790 chrome::NOTIFICATION_CLOSE_ALL_BROWSERS_REQUEST, |
| 791 content::NotificationService::AllSources()); | 791 content::NotificationService::AllSources()); |
| 792 registrar_.Remove(this, | 792 registrar_.Remove(this, |
| 793 chrome::NOTIFICATION_BROWSER_OPENED, | 793 chrome::NOTIFICATION_BROWSER_OPENED, |
| 794 content::NotificationService::AllSources()); | 794 content::NotificationService::AllSources()); |
| 795 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && | 795 } else if (type == chrome::NOTIFICATION_LOGIN_USER_CHANGED && |
| 796 chromeos::UserManager::Get()->IsCurrentUserNew()) { | 796 chromeos::GetUserManager()->IsCurrentUserNew()) { |
| 797 // For new user, move desktop to locker container so that windows created | 797 // For new user, move desktop to locker container so that windows created |
| 798 // during the user image picker step are below it. | 798 // during the user image picker step are below it. |
| 799 ash::Shell::GetInstance()-> | 799 ash::Shell::GetInstance()-> |
| 800 desktop_background_controller()->MoveDesktopToLockedContainer(); | 800 desktop_background_controller()->MoveDesktopToLockedContainer(); |
| 801 registrar_.Remove(this, | 801 registrar_.Remove(this, |
| 802 chrome::NOTIFICATION_LOGIN_USER_CHANGED, | 802 chrome::NOTIFICATION_LOGIN_USER_CHANGED, |
| 803 content::NotificationService::AllSources()); | 803 content::NotificationService::AllSources()); |
| 804 } | 804 } |
| 805 } | 805 } |
| 806 | 806 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 scoped_ptr<locale_util::SwitchLanguageCallback> callback( | 1276 scoped_ptr<locale_util::SwitchLanguageCallback> callback( |
| 1277 new locale_util::SwitchLanguageCallback( | 1277 new locale_util::SwitchLanguageCallback( |
| 1278 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); | 1278 base::Bind(&OnLanguageSwitchedCallback, base::Passed(data.Pass())))); |
| 1279 | 1279 |
| 1280 // Load locale keyboards here. Hardware layout would be automatically enabled. | 1280 // Load locale keyboards here. Hardware layout would be automatically enabled. |
| 1281 locale_util::SwitchLanguage( | 1281 locale_util::SwitchLanguage( |
| 1282 locale, true, true /* login_layouts_only */, callback.Pass()); | 1282 locale, true, true /* login_layouts_only */, callback.Pass()); |
| 1283 } | 1283 } |
| 1284 | 1284 |
| 1285 } // namespace chromeos | 1285 } // namespace chromeos |
| OLD | NEW |