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

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

Issue 296823009: ChromeOS login webui refactoring: split user selection/gaia login screens. (Closed) Base URL: http://git.chromium.org/chromium/src.git@refactoring-1
Patch Set: Created 6 years, 7 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/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 51895c955c838331a2b847fe830590b1cc1e9194..6d4f907a68427bf439774a2df99ad0ba9c338960 100644
--- a/chrome/browser/chromeos/login/ui/webui_login_display.cc
+++ b/chrome/browser/chromeos/login/ui/webui_login_display.cc
@@ -23,12 +23,6 @@
namespace chromeos {
-namespace {
-
-const int kPasswordClearTimeoutSec = 60;
-
-}
-
// WebUILoginDisplay, public: --------------------------------------------------
WebUILoginDisplay::~WebUILoginDisplay() {
@@ -63,7 +57,7 @@ void WebUILoginDisplay::Init(const UserList& users,
// Testing that the delegate has been set.
DCHECK(delegate_);
- user_selection_screen_->Init(users);
+ user_selection_screen_->Init(users, show_guest);
show_guest_ = show_guest;
show_users_ = show_users;
show_new_user_ = show_new_user;
@@ -108,27 +102,29 @@ void WebUILoginDisplay::ShowBannerMessage(const std::string& message) {
webui_handler_->ShowBannerMessage(message);
}
-
void WebUILoginDisplay::SetAuthType(const std::string& username,
AuthType auth_type,
const std::string& initial_value) {
- if (!webui_handler_)
- return;
- webui_handler_->SetAuthType(username, auth_type, initial_value);
+ user_selection_screen_->SetAuthType(username, auth_type, initial_value);
}
LoginDisplay::AuthType WebUILoginDisplay::GetAuthType(
const std::string& username) const {
- // Return default auth type if WebUI hander is not ready.
- if (!webui_handler_)
- return OFFLINE_PASSWORD;
- return webui_handler_->GetAuthType(username);
+ return user_selection_screen_->GetAuthType(username);
}
const UserList& WebUILoginDisplay::GetUsers() const {
return user_selection_screen_->GetUsers();
}
+void WebUILoginDisplay::HandleCustomButtonClicked(const std::string& user_id) {
+ user_selection_screen_->HandleCustomButtonClicked(user_id);
+}
+
+void WebUILoginDisplay::HandleGetUsers() {
+ user_selection_screen_->HandleGetUsers();
+}
+
// ---- Gaia screen methods
// ---- Not yet classified methods
@@ -371,10 +367,6 @@ bool WebUILoginDisplay::IsShowUsers() const {
return show_users_;
}
-bool WebUILoginDisplay::IsShowNewUser() const {
- return show_new_user_;
-}
-
bool WebUILoginDisplay::IsSigninInProgress() const {
return delegate_->IsSigninInProgress();
}
@@ -398,23 +390,9 @@ void WebUILoginDisplay::LoginAsKioskApp(const std::string& app_id,
}
void WebUILoginDisplay::OnUserActivity(const ui::Event* event) {
- if (!password_clear_timer_.IsRunning())
- StartPasswordClearTimer();
- password_clear_timer_.Reset();
if (delegate_)
delegate_->ResetPublicSessionAutoLoginTimer();
}
-void WebUILoginDisplay::StartPasswordClearTimer() {
- DCHECK(!password_clear_timer_.IsRunning());
- password_clear_timer_.Start(FROM_HERE,
- base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this,
- &WebUILoginDisplay::OnPasswordClearTimerExpired);
-}
-
-void WebUILoginDisplay::OnPasswordClearTimerExpired() {
- if (webui_handler_)
- webui_handler_->ClearUserPodPassword();
-}
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698