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

Side by Side Diff: chrome/browser/chromeos/login/webui_login_display.cc

Issue 168813002: Refactor user pods to use authType property for distinct authentication modes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ScreenLockerTest Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 LoginDisplay::AuthType WebUILoginDisplay::GetAuthType(
159 const std::string& username) const {
160 // Return default auth type if WebUI hander is not ready.
161 if (!webui_handler_)
162 return OFFLINE_PASSWORD;
163 return webui_handler_->GetAuthType(username);
164 }
165
144 void WebUILoginDisplay::ShowError(int error_msg_id, 166 void WebUILoginDisplay::ShowError(int error_msg_id,
145 int login_attempts, 167 int login_attempts,
146 HelpAppLauncher::HelpTopic help_topic_id) { 168 HelpAppLauncher::HelpTopic help_topic_id) {
147 VLOG(1) << "Show error, error_id: " << error_msg_id 169 VLOG(1) << "Show error, error_id: " << error_msg_id
148 << ", attempts:" << login_attempts 170 << ", attempts:" << login_attempts
149 << ", help_topic_id: " << help_topic_id; 171 << ", help_topic_id: " << help_topic_id;
150 if (!webui_handler_) 172 if (!webui_handler_)
151 return; 173 return;
152 174
153 std::string error_text; 175 std::string error_text;
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this, 420 base::TimeDelta::FromSeconds(kPasswordClearTimeoutSec), this,
399 &WebUILoginDisplay::OnPasswordClearTimerExpired); 421 &WebUILoginDisplay::OnPasswordClearTimerExpired);
400 } 422 }
401 423
402 void WebUILoginDisplay::OnPasswordClearTimerExpired() { 424 void WebUILoginDisplay::OnPasswordClearTimerExpired() {
403 if (webui_handler_) 425 if (webui_handler_)
404 webui_handler_->ClearUserPodPassword(); 426 webui_handler_->ClearUserPodPassword();
405 } 427 }
406 428
407 } // namespace chromeos 429 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/webui_login_display.h ('k') | chrome/browser/chromeos/login/webui_screen_locker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698