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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 SetInputEnabled(true); | 91 SetInputEnabled(true); |
92 } | 92 } |
93 | 93 |
94 void WebUIScreenLocker::OnAuthenticate() { | 94 void WebUIScreenLocker::OnAuthenticate() { |
95 } | 95 } |
96 | 96 |
97 void WebUIScreenLocker::SetInputEnabled(bool enabled) { | 97 void WebUIScreenLocker::SetInputEnabled(bool enabled) { |
98 login_display_->SetUIEnabled(enabled); | 98 login_display_->SetUIEnabled(enabled); |
99 } | 99 } |
100 | 100 |
101 void WebUIScreenLocker::ShowBannerMessage(const std::string& message) { | |
102 if (!webui_ready_) | |
103 return; | |
104 login_display_->ShowBannerMessage(message); | |
105 } | |
106 | |
107 void WebUIScreenLocker::ShowUserPodButton( | |
108 const std::string& username, | |
109 const std::string& iconURL, | |
110 const base::Closure& click_callback) { | |
111 if (!webui_ready_) | |
112 return; | |
113 login_display_->ShowUserPodButton(username, iconURL, click_callback); | |
114 } | |
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 | |
138 void WebUIScreenLocker::ShowErrorMessage( | 101 void WebUIScreenLocker::ShowErrorMessage( |
139 int error_msg_id, | 102 int error_msg_id, |
140 HelpAppLauncher::HelpTopic help_topic_id) { | 103 HelpAppLauncher::HelpTopic help_topic_id) { |
141 login_display_->ShowError(error_msg_id, | 104 login_display_->ShowError(error_msg_id, |
142 0 /* login_attempts */, | 105 0 /* login_attempts */, |
143 help_topic_id); | 106 help_topic_id); |
144 } | 107 } |
145 | 108 |
146 void WebUIScreenLocker::AnimateAuthenticationSuccess() { | 109 void WebUIScreenLocker::AnimateAuthenticationSuccess() { |
147 GetWebUI()->CallJavascriptFunction("cr.ui.Oobe.animateAuthenticationSuccess"); | 110 GetWebUI()->CallJavascriptFunction("cr.ui.Oobe.animateAuthenticationSuccess"); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 | 315 |
353 void WebUIScreenLocker::RenderProcessGone(base::TerminationStatus status) { | 316 void WebUIScreenLocker::RenderProcessGone(base::TerminationStatus status) { |
354 if (browser_shutdown::GetShutdownType() == browser_shutdown::NOT_VALID && | 317 if (browser_shutdown::GetShutdownType() == browser_shutdown::NOT_VALID && |
355 status != base::TERMINATION_STATUS_NORMAL_TERMINATION) { | 318 status != base::TERMINATION_STATUS_NORMAL_TERMINATION) { |
356 LOG(ERROR) << "Renderer crash on lock screen"; | 319 LOG(ERROR) << "Renderer crash on lock screen"; |
357 Signout(); | 320 Signout(); |
358 } | 321 } |
359 } | 322 } |
360 | 323 |
361 } // namespace chromeos | 324 } // namespace chromeos |
OLD | NEW |