| Index: chrome/browser/chromeos/login/ui/webui_login_display.cc
|
| diff --git a/chrome/browser/chromeos/login/ui/webui_login_display.cc b/chrome/browser/chromeos/login/ui/webui_login_display.cc
|
| index 7e5b35786de2cc79c00e2c194a9c30ea158c7999..6e3f60ae58727712607a7132480a9805305ec30d 100644
|
| --- a/chrome/browser/chromeos/login/ui/webui_login_display.cc
|
| +++ b/chrome/browser/chromeos/login/ui/webui_login_display.cc
|
| @@ -46,7 +46,9 @@ WebUILoginDisplay::WebUILoginDisplay(LoginDisplay::Delegate* delegate)
|
| : LoginDisplay(delegate, gfx::Rect()),
|
| show_guest_(false),
|
| show_new_user_(false),
|
| - webui_handler_(NULL) {
|
| + webui_handler_(NULL),
|
| + gaia_screen_(new GaiaScreen()),
|
| + user_selection_screen_(new UserSelectionScreen()) {
|
| }
|
|
|
| void WebUILoginDisplay::ClearAndEnablePassword() {
|
| @@ -61,7 +63,7 @@ void WebUILoginDisplay::Init(const UserList& users,
|
| // Testing that the delegate has been set.
|
| DCHECK(delegate_);
|
|
|
| - users_ = users;
|
| + user_selection_screen_->Init(users);
|
| show_guest_ = show_guest;
|
| show_users_ = show_users;
|
| show_new_user_ = show_new_user;
|
| @@ -72,36 +74,35 @@ void WebUILoginDisplay::Init(const UserList& users,
|
| activity_detector->AddObserver(this);
|
| }
|
|
|
| -void WebUILoginDisplay::OnPreferencesChanged() {
|
| - if (webui_handler_)
|
| - webui_handler_->OnPreferencesChanged();
|
| -}
|
| +// ---- Common methods
|
| +
|
| +// ---- User selection screen methods
|
|
|
| void WebUILoginDisplay::OnBeforeUserRemoved(const std::string& username) {
|
| - for (UserList::iterator it = users_.begin(); it != users_.end(); ++it) {
|
| - if ((*it)->email() == username) {
|
| - users_.erase(it);
|
| - break;
|
| - }
|
| - }
|
| + user_selection_screen_->OnBeforeUserRemoved(username);
|
| }
|
|
|
| -void WebUILoginDisplay::OnUserImageChanged(const User& user) {
|
| - if (webui_handler_)
|
| - webui_handler_->OnUserImageChanged(user);
|
| +void WebUILoginDisplay::OnUserRemoved(const std::string& username) {
|
| + user_selection_screen_->OnUserRemoved(username);
|
| }
|
|
|
| -void WebUILoginDisplay::OnUserRemoved(const std::string& username) {
|
| - if (webui_handler_)
|
| - webui_handler_->OnUserRemoved(username);
|
| +void WebUILoginDisplay::OnUserImageChanged(const User& user) {
|
| + user_selection_screen_->OnUserImageChanged(user);
|
| }
|
|
|
| -void WebUILoginDisplay::OnFadeOut() {
|
| +// User selection screen, screen lock API
|
| +
|
| +const UserList& WebUILoginDisplay::GetUsers() const {
|
| + return user_selection_screen_->GetUsers();
|
| }
|
|
|
| -void WebUILoginDisplay::OnLoginSuccess(const std::string& username) {
|
| +// ---- Gaia screen methods
|
| +
|
| +// ---- Not yet classified methods
|
| +
|
| +void WebUILoginDisplay::OnPreferencesChanged() {
|
| if (webui_handler_)
|
| - webui_handler_->OnLoginSuccess(username);
|
| + webui_handler_->OnPreferencesChanged();
|
| }
|
|
|
| void WebUILoginDisplay::SetUIEnabled(bool is_enabled) {
|
| @@ -110,9 +111,8 @@ void WebUILoginDisplay::SetUIEnabled(bool is_enabled) {
|
| // Allow this call only before user sign in or at lock screen.
|
| // If this call is made after new user signs in but login screen is still
|
| // around that would trigger a sign in extension refresh.
|
| - if (is_enabled &&
|
| - (!UserManager::Get()->IsUserLoggedIn() ||
|
| - ScreenLocker::default_screen_locker())) {
|
| + if (is_enabled && (!UserManager::Get()->IsUserLoggedIn() ||
|
| + ScreenLocker::default_screen_locker())) {
|
| ClearAndEnablePassword();
|
| }
|
|
|
| @@ -123,9 +123,6 @@ void WebUILoginDisplay::SetUIEnabled(bool is_enabled) {
|
| }
|
| }
|
|
|
| -void WebUILoginDisplay::SelectPod(int index) {
|
| -}
|
| -
|
| void WebUILoginDisplay::ShowError(int error_msg_id,
|
| int login_attempts,
|
| HelpAppLauncher::HelpTopic help_topic_id) {
|
| @@ -322,6 +319,8 @@ void WebUILoginDisplay::ShowWrongHWIDScreen() {
|
| void WebUILoginDisplay::SetWebUIHandler(
|
| LoginDisplayWebUIHandler* webui_handler) {
|
| webui_handler_ = webui_handler;
|
| + gaia_screen_->SetHandler(webui_handler_);
|
| + user_selection_screen_->SetHandler(webui_handler_);
|
| }
|
|
|
| void WebUILoginDisplay::ShowSigninScreenForCreds(
|
| @@ -331,10 +330,6 @@ void WebUILoginDisplay::ShowSigninScreenForCreds(
|
| webui_handler_->ShowSigninScreenForCreds(username, password);
|
| }
|
|
|
| -const UserList& WebUILoginDisplay::GetUsers() const {
|
| - return users_;
|
| -}
|
| -
|
| bool WebUILoginDisplay::IsShowGuest() const {
|
| return show_guest_;
|
| }
|
|
|