Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2114)

Unified Diff: chrome/browser/chromeos/login/webui_login_display.cc

Issue 7461142: [ChromeOS] Assorted WebUI login fixes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comment in #1 Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/webui_login_display.cc
diff --git a/chrome/browser/chromeos/login/webui_login_display.cc b/chrome/browser/chromeos/login/webui_login_display.cc
index 08304a842c831ee41a6afe6bc0b36ca44981e805..cd8b02b22331817270c6f0dc2d6ad6cf9e9fb073 100644
--- a/chrome/browser/chromeos/login/webui_login_display.cc
+++ b/chrome/browser/chromeos/login/webui_login_display.cc
@@ -50,7 +50,10 @@ void WebUILoginDisplay::Init(const std::vector<UserManager::User>& users,
bool show_new_user) {
// Testing that the delegate has been set.
DCHECK(delegate_);
+
users_ = users;
+ show_guest_ = show_guest;
+ show_new_user_ = show_new_user;
}
void WebUILoginDisplay::OnBeforeUserRemoved(const std::string& username) {
@@ -64,8 +67,18 @@ void WebUILoginDisplay::OnUserImageChanged(UserManager::User* user) {
}
void WebUILoginDisplay::OnUserRemoved(const std::string& username) {
- // TODO(rharrison): Remove the user from the user vector
- // TODO(rharrison): Push the change to WebUI Login screen
+ DCHECK(webui_handler_);
+
+ for (std::vector<UserManager::User>::iterator it = users_.begin();
+ it != users_.end();
+ ++it) {
+ if (it->email() == username) {
+ users_.erase(it);
+ break;
+ }
+ }
+
+ webui_handler_->OnUserRemoved(username);
}
void WebUILoginDisplay::OnFadeOut() {
@@ -126,19 +139,11 @@ void WebUILoginDisplay::ShowError(int error_msg_id,
break;
}
- webui_handler_->ShowError(error_text, help_link, help_topic_id);
+ webui_handler_->ShowError(login_attempts, error_text, help_link,
+ help_topic_id);
}
// WebUILoginDisplay, SigninScreenHandlerDelegate implementation: --------------
-void WebUILoginDisplay::SetWebUIHandler(
- LoginDisplayWebUIHandler* webui_handler) {
- webui_handler_ = webui_handler;
-}
-
-void WebUILoginDisplay::ShowEnterpriseEnrollmentScreen() {
- delegate_->OnStartEnterpriseEnrollment();
-}
-
void WebUILoginDisplay::CompleteLogin(const std::string& username,
const std::string& password) {
DCHECK(delegate_);
@@ -156,12 +161,27 @@ void WebUILoginDisplay::LoginAsGuest() {
delegate_->LoginAsGuest();
}
+void WebUILoginDisplay::RemoveUser(const std::string& username) {
+ UserManager::Get()->RemoveUser(username, this);
+}
+
+void WebUILoginDisplay::ShowEnterpriseEnrollmentScreen() {
+ delegate_->OnStartEnterpriseEnrollment();
+}
+
+void WebUILoginDisplay::SetWebUIHandler(
+ LoginDisplayWebUIHandler* webui_handler) {
+ webui_handler_ = webui_handler;
+}
+
// WebUILoginDisplay, private: -------------------------------------------------
// Singleton implementation: ---------------------------------------------------
WebUILoginDisplay::WebUILoginDisplay()
: LoginDisplay(NULL, gfx::Rect()),
+ show_guest_(false),
+ show_new_user_(false),
login_window_(NULL),
webui_handler_(NULL) {
}
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display.h ('k') | chrome/browser/resources/chromeos/login/bubble.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698