Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui_login_display.h" | 5 #include "chrome/browser/chromeos/login/webui_login_display.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/user_activity_detector.h" | 8 #include "ash/wm/user_activity_detector.h" |
| 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 9 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 10 #include "chrome/browser/chromeos/login/login_display_host_impl.h" | 10 #include "chrome/browser/chromeos/login/login_display_host_impl.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 | 134 |
| 135 void WebUILoginDisplay::ShowUserPodButton( | 135 void WebUILoginDisplay::ShowUserPodButton( |
| 136 const std::string& username, | 136 const std::string& username, |
| 137 const std::string& iconURL, | 137 const std::string& iconURL, |
| 138 const base::Closure& click_callback) { | 138 const base::Closure& click_callback) { |
| 139 if (!webui_handler_) | 139 if (!webui_handler_) |
| 140 return; | 140 return; |
| 141 webui_handler_->ShowUserPodButton(username, iconURL, click_callback); | 141 webui_handler_->ShowUserPodButton(username, iconURL, click_callback); |
| 142 } | 142 } |
| 143 | 143 |
| 144 void WebUILoginDisplay::HideUserPodButton(const std::string& username) { | |
| 145 if (!webui_handler_) | |
| 146 return; | |
| 147 webui_handler_->HideUserPodButton(username); | |
| 148 } | |
| 149 | |
| 150 void WebUILoginDisplay::SetAuthType(const std::string& username, | |
| 151 AuthType auth_type, | |
| 152 const std::string& initial_value) { | |
| 153 if (!webui_handler_) | |
| 154 return; | |
| 155 webui_handler_->SetAuthType(username, auth_type, initial_value); | |
| 156 } | |
| 157 | |
| 158 // Set the authentication type to be used on the lock screen. | |
|
Nikita (slow)
2014/02/20 15:12:18
nit: Comment can be dropped here.
Tim Song
2014/02/20 22:14:01
Done.
| |
| 159 LoginDisplay::AuthType WebUILoginDisplay::GetAuthType( | |
| 160 const std::string& username) const { | |
| 161 // Return default auth type if WebUI hander is not ready. | |
| 162 if (!webui_handler_) | |
| 163 return OFFLINE_PASSWORD; | |
| 164 return webui_handler_->GetAuthType(username); | |
| 165 } | |
| 166 | |
| 144 void WebUILoginDisplay::ShowError(int error_msg_id, | 167 void WebUILoginDisplay::ShowError(int error_msg_id, |
| 145 int login_attempts, | 168 int login_attempts, |
| 146 HelpAppLauncher::HelpTopic help_topic_id) { | 169 HelpAppLauncher::HelpTopic help_topic_id) { |
| 147 VLOG(1) << "Show error, error_id: " << error_msg_id | 170 VLOG(1) << "Show error, error_id: " << error_msg_id |
| 148 << ", attempts:" << login_attempts | 171 << ", attempts:" << login_attempts |
| 149 << ", help_topic_id: " << help_topic_id; | 172 << ", help_topic_id: " << help_topic_id; |
| 150 if (!webui_handler_) | 173 if (!webui_handler_) |
| 151 return; | 174 return; |
| 152 | 175 |
| 153 std::string error_text; | 176 std::string error_text; |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 398 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, | 421 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, |
| 399 &WebUILoginDisplay::OnPasswordClearTimerExpired); | 422 &WebUILoginDisplay::OnPasswordClearTimerExpired); |
| 400 } | 423 } |
| 401 | 424 |
| 402 void WebUILoginDisplay::OnPasswordClearTimerExpired() { | 425 void WebUILoginDisplay::OnPasswordClearTimerExpired() { |
| 403 if (webui_handler_) | 426 if (webui_handler_) |
| 404 webui_handler_->ClearUserPodPassword(); | 427 webui_handler_->ClearUserPodPassword(); |
| 405 } | 428 } |
| 406 | 429 |
| 407 } // namespace chromeos | 430 } // namespace chromeos |
| OLD | NEW |