OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/lock/webui_screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 SetInputEnabled(true); | 92 SetInputEnabled(true); |
93 } | 93 } |
94 | 94 |
95 void WebUIScreenLocker::OnAuthenticate() { | 95 void WebUIScreenLocker::OnAuthenticate() { |
96 } | 96 } |
97 | 97 |
98 void WebUIScreenLocker::SetInputEnabled(bool enabled) { | 98 void WebUIScreenLocker::SetInputEnabled(bool enabled) { |
99 login_display_->SetUIEnabled(enabled); | 99 login_display_->SetUIEnabled(enabled); |
100 } | 100 } |
101 | 101 |
102 void WebUIScreenLocker::ShowBannerMessage(const std::string& message) { | |
103 if (!webui_ready_) | |
104 return; | |
105 login_display_->ShowBannerMessage(message); | |
106 } | |
107 | |
108 void WebUIScreenLocker::ShowUserPodButton( | |
109 const std::string& username, | |
110 const std::string& iconURL, | |
111 const base::Closure& click_callback) { | |
112 if (!webui_ready_) | |
113 return; | |
114 login_display_->ShowUserPodButton(username, iconURL, click_callback); | |
115 } | |
116 | |
117 void WebUIScreenLocker::HideUserPodButton(const std::string& username) { | |
118 if (!webui_ready_) | |
119 return; | |
120 login_display_->HideUserPodButton(username); | |
121 } | |
122 | |
123 void WebUIScreenLocker::SetAuthType(const std::string& username, | |
124 LoginDisplay::AuthType auth_type, | |
125 const std::string& initial_value) { | |
126 if (!webui_ready_) | |
127 return; | |
128 login_display_->SetAuthType(username, auth_type, initial_value); | |
129 } | |
130 | |
131 LoginDisplay::AuthType WebUIScreenLocker::GetAuthType( | |
132 const std::string& username) const { | |
133 // Return default auth type if login display is not ready. | |
134 if (!webui_ready_) | |
135 return LoginDisplay::OFFLINE_PASSWORD; | |
136 return login_display_->GetAuthType(username); | |
137 } | |
138 | |
139 void WebUIScreenLocker::ShowErrorMessage( | 102 void WebUIScreenLocker::ShowErrorMessage( |
140 int error_msg_id, | 103 int error_msg_id, |
141 HelpAppLauncher::HelpTopic help_topic_id) { | 104 HelpAppLauncher::HelpTopic help_topic_id) { |
142 login_display_->ShowError(error_msg_id, | 105 login_display_->ShowError(error_msg_id, |
143 0 /* login_attempts */, | 106 0 /* login_attempts */, |
144 help_topic_id); | 107 help_topic_id); |
145 } | 108 } |
146 | 109 |
147 void WebUIScreenLocker::AnimateAuthenticationSuccess() { | 110 void WebUIScreenLocker::AnimateAuthenticationSuccess() { |
148 GetWebUI()->CallJavascriptFunction("cr.ui.Oobe.animateAuthenticationSuccess"); | 111 GetWebUI()->CallJavascriptFunction("cr.ui.Oobe.animateAuthenticationSuccess"); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 | 316 |
354 void WebUIScreenLocker::RenderProcessGone(base::TerminationStatus status) { | 317 void WebUIScreenLocker::RenderProcessGone(base::TerminationStatus status) { |
355 if (browser_shutdown::GetShutdownType() == browser_shutdown::NOT_VALID && | 318 if (browser_shutdown::GetShutdownType() == browser_shutdown::NOT_VALID && |
356 status != base::TERMINATION_STATUS_NORMAL_TERMINATION) { | 319 status != base::TERMINATION_STATUS_NORMAL_TERMINATION) { |
357 LOG(ERROR) << "Renderer crash on lock screen"; | 320 LOG(ERROR) << "Renderer crash on lock screen"; |
358 Signout(); | 321 Signout(); |
359 } | 322 } |
360 } | 323 } |
361 | 324 |
362 } // namespace chromeos | 325 } // namespace chromeos |
OLD | NEW |