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

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

Issue 10213003: chromeos: Break WebUILoginDisplay and SigninScreenHandler coupling on destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for comments in #1 Created 8 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3e8f95cec9f12e8f95bece8534d25a67d726abbf..2df9d555002564faf376c839e319dde33f8d34c7 100644
--- a/chrome/browser/chromeos/login/webui_login_display.cc
+++ b/chrome/browser/chromeos/login/webui_login_display.cc
@@ -20,6 +20,8 @@ namespace chromeos {
// WebUILoginDisplay, public: --------------------------------------------------
WebUILoginDisplay::~WebUILoginDisplay() {
+ if (webui_handler_)
+ webui_handler_->ResetSigninScreenHandlerDelegate();
}
// LoginDisplay implementation: ------------------------------------------------
@@ -59,24 +61,25 @@ void WebUILoginDisplay::OnBeforeUserRemoved(const std::string& username) {
}
void WebUILoginDisplay::OnUserImageChanged(const User& user) {
- DCHECK(webui_handler_);
- webui_handler_->OnUserImageChanged(user);
+ if (webui_handler_)
+ webui_handler_->OnUserImageChanged(user);
}
void WebUILoginDisplay::OnUserRemoved(const std::string& username) {
- DCHECK(webui_handler_);
- webui_handler_->OnUserRemoved(username);
+ if (webui_handler_)
+ webui_handler_->OnUserRemoved(username);
}
void WebUILoginDisplay::OnFadeOut() {
}
void WebUILoginDisplay::OnLoginSuccess(const std::string& username) {
- webui_handler_->OnLoginSuccess(username);
+ if (webui_handler_)
+ webui_handler_->OnLoginSuccess(username);
}
void WebUILoginDisplay::SetUIEnabled(bool is_enabled) {
- if (is_enabled)
+ if (webui_handler_ && is_enabled)
webui_handler_->ClearAndEnablePassword();
}
@@ -89,7 +92,8 @@ void WebUILoginDisplay::ShowError(int error_msg_id,
VLOG(1) << "Show error, error_id: " << error_msg_id
<< ", attempts:" << login_attempts
<< ", help_topic_id: " << help_topic_id;
- DCHECK(webui_handler_);
+ if (!webui_handler_)
+ return;
std::string error_text;
switch (error_msg_id) {
@@ -138,7 +142,8 @@ void WebUILoginDisplay::ShowError(int error_msg_id,
}
void WebUILoginDisplay::ShowGaiaPasswordChanged(const std::string& username) {
- webui_handler_->ShowGaiaPasswordChanged(username);
+ if (webui_handler_)
+ webui_handler_->ShowGaiaPasswordChanged(username);
}
// WebUILoginDisplay, SigninScreenHandlerDelegate implementation: --------------
@@ -195,8 +200,8 @@ void WebUILoginDisplay::SetWebUIHandler(
void WebUILoginDisplay::ShowSigninScreenForCreds(
const std::string& username,
const std::string& password) {
- DCHECK(webui_handler_);
- webui_handler_->ShowSigninScreenForCreds(username, password);
+ if (webui_handler_)
+ webui_handler_->ShowSigninScreenForCreds(username, password);
}
const UserList& WebUILoginDisplay::GetUsers() const {
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698