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_screen_locker.h" | 5 #include "chrome/browser/chromeos/login/webui_screen_locker.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/lock_state_controller.h" | 8 #include "ash/wm/lock_state_controller.h" |
9 #include "ash/wm/lock_state_observer.h" | 9 #include "ash/wm/lock_state_observer.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 void WebUIScreenLocker::ShowUserPodButton( | 107 void WebUIScreenLocker::ShowUserPodButton( |
108 const std::string& username, | 108 const std::string& username, |
109 const std::string& iconURL, | 109 const std::string& iconURL, |
110 const base::Closure& click_callback) { | 110 const base::Closure& click_callback) { |
111 if (!webui_ready_) | 111 if (!webui_ready_) |
112 return; | 112 return; |
113 login_display_->ShowUserPodButton(username, iconURL, click_callback); | 113 login_display_->ShowUserPodButton(username, iconURL, click_callback); |
114 } | 114 } |
115 | 115 |
| 116 void WebUIScreenLocker::HideUserPodButton(const std::string& username) { |
| 117 if (!webui_ready_) |
| 118 return; |
| 119 login_display_->HideUserPodButton(username); |
| 120 } |
| 121 |
| 122 void WebUIScreenLocker::SetAuthType(const std::string& username, |
| 123 LoginDisplay::AuthType auth_type, |
| 124 const std::string& initial_value) { |
| 125 if (!webui_ready_) |
| 126 return; |
| 127 login_display_->SetAuthType(username, auth_type, initial_value); |
| 128 } |
| 129 |
| 130 LoginDisplay::AuthType WebUIScreenLocker::GetAuthType( |
| 131 const std::string& username) const { |
| 132 // Return default auth type if login display is not ready. |
| 133 if (!webui_ready_) |
| 134 return LoginDisplay::OFFLINE_PASSWORD; |
| 135 return login_display_->GetAuthType(username); |
| 136 } |
| 137 |
116 void WebUIScreenLocker::ShowErrorMessage( | 138 void WebUIScreenLocker::ShowErrorMessage( |
117 int error_msg_id, | 139 int error_msg_id, |
118 HelpAppLauncher::HelpTopic help_topic_id) { | 140 HelpAppLauncher::HelpTopic help_topic_id) { |
119 login_display_->ShowError(error_msg_id, | 141 login_display_->ShowError(error_msg_id, |
120 0 /* login_attempts */, | 142 0 /* login_attempts */, |
121 help_topic_id); | 143 help_topic_id); |
122 } | 144 } |
123 | 145 |
124 void WebUIScreenLocker::AnimateAuthenticationSuccess() { | 146 void WebUIScreenLocker::AnimateAuthenticationSuccess() { |
125 GetWebUI()->CallJavascriptFunction("cr.ui.Oobe.animateAuthenticationSuccess"); | 147 GetWebUI()->CallJavascriptFunction("cr.ui.Oobe.animateAuthenticationSuccess"); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 356 |
335 void WebUIScreenLocker::RenderProcessGone(base::TerminationStatus status) { | 357 void WebUIScreenLocker::RenderProcessGone(base::TerminationStatus status) { |
336 if (browser_shutdown::GetShutdownType() == browser_shutdown::NOT_VALID && | 358 if (browser_shutdown::GetShutdownType() == browser_shutdown::NOT_VALID && |
337 status != base::TERMINATION_STATUS_NORMAL_TERMINATION) { | 359 status != base::TERMINATION_STATUS_NORMAL_TERMINATION) { |
338 LOG(ERROR) << "Renderer crash on lock screen"; | 360 LOG(ERROR) << "Renderer crash on lock screen"; |
339 Signout(); | 361 Signout(); |
340 } | 362 } |
341 } | 363 } |
342 | 364 |
343 } // namespace chromeos | 365 } // namespace chromeos |
OLD | NEW |