| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/webui/chromeos/login/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/chromeos/chromeos_version.h" | 8 #include "base/chromeos/chromeos_version.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 &SigninScreenHandler::HandleLoginUIStateChanged); | 845 &SigninScreenHandler::HandleLoginUIStateChanged); |
| 846 AddCallback("unlockOnLoginSuccess", | 846 AddCallback("unlockOnLoginSuccess", |
| 847 &SigninScreenHandler::HandleUnlockOnLoginSuccess); | 847 &SigninScreenHandler::HandleUnlockOnLoginSuccess); |
| 848 AddCallback("frameLoadingCompleted", | 848 AddCallback("frameLoadingCompleted", |
| 849 &SigninScreenHandler::HandleFrameLoadingCompleted); | 849 &SigninScreenHandler::HandleFrameLoadingCompleted); |
| 850 AddCallback("showLoadingTimeoutError", | 850 AddCallback("showLoadingTimeoutError", |
| 851 &SigninScreenHandler::HandleShowLoadingTimeoutError); | 851 &SigninScreenHandler::HandleShowLoadingTimeoutError); |
| 852 AddCallback("updateOfflineLogin", | 852 AddCallback("updateOfflineLogin", |
| 853 &SigninScreenHandler::HandleUpdateOfflineLogin); | 853 &SigninScreenHandler::HandleUpdateOfflineLogin); |
| 854 AddCallback("focusPod", &SigninScreenHandler::HandleFocusPod); | 854 AddCallback("focusPod", &SigninScreenHandler::HandleFocusPod); |
| 855 |
| 856 // This message is sent by the kiosk app menu, but is handled here |
| 857 // so we can tell the delegate to launch the app. |
| 858 AddCallback("launchKioskApp", &SigninScreenHandler::HandleLaunchKioskApp); |
| 855 } | 859 } |
| 856 | 860 |
| 857 void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) { | 861 void SigninScreenHandler::RegisterPrefs(PrefRegistrySimple* registry) { |
| 858 registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod); | 862 registry->RegisterDictionaryPref(prefs::kUsersLRUInputMethod); |
| 859 } | 863 } |
| 860 | 864 |
| 861 void SigninScreenHandler::HandleGetUsers() { | 865 void SigninScreenHandler::HandleGetUsers() { |
| 862 SendUserList(false); | 866 SendUserList(false); |
| 863 } | 867 } |
| 864 | 868 |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1619 } | 1623 } |
| 1620 | 1624 |
| 1621 void SigninScreenHandler::HandleUpdateOfflineLogin(bool offline_login_active) { | 1625 void SigninScreenHandler::HandleUpdateOfflineLogin(bool offline_login_active) { |
| 1622 offline_login_active_ = offline_login_active; | 1626 offline_login_active_ = offline_login_active; |
| 1623 } | 1627 } |
| 1624 | 1628 |
| 1625 void SigninScreenHandler::HandleFocusPod(const std::string& user_id) { | 1629 void SigninScreenHandler::HandleFocusPod(const std::string& user_id) { |
| 1626 SetUserInputMethod(user_id); | 1630 SetUserInputMethod(user_id); |
| 1627 } | 1631 } |
| 1628 | 1632 |
| 1633 void SigninScreenHandler::HandleLaunchKioskApp(const std::string& app_id) { |
| 1634 delegate_->LoginAsKioskApp(app_id); |
| 1635 } |
| 1636 |
| 1629 void SigninScreenHandler::StartClearingDnsCache() { | 1637 void SigninScreenHandler::StartClearingDnsCache() { |
| 1630 if (dns_clear_task_running_ || !g_browser_process->io_thread()) | 1638 if (dns_clear_task_running_ || !g_browser_process->io_thread()) |
| 1631 return; | 1639 return; |
| 1632 | 1640 |
| 1633 dns_cleared_ = false; | 1641 dns_cleared_ = false; |
| 1634 BrowserThread::PostTaskAndReply( | 1642 BrowserThread::PostTaskAndReply( |
| 1635 BrowserThread::IO, FROM_HERE, | 1643 BrowserThread::IO, FROM_HERE, |
| 1636 base::Bind(&ClearDnsCache, g_browser_process->io_thread()), | 1644 base::Bind(&ClearDnsCache, g_browser_process->io_thread()), |
| 1637 base::Bind(&SigninScreenHandler::OnDnsCleared, | 1645 base::Bind(&SigninScreenHandler::OnDnsCleared, |
| 1638 weak_factory_.GetWeakPtr())); | 1646 weak_factory_.GetWeakPtr())); |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1756 rvh->ExecuteJavascriptInWebFrame( | 1764 rvh->ExecuteJavascriptInWebFrame( |
| 1757 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), | 1765 ASCIIToUTF16("//iframe[@id='signin-frame']\n//iframe"), |
| 1758 ASCIIToUTF16(code)); | 1766 ASCIIToUTF16(code)); |
| 1759 | 1767 |
| 1760 // Test properties are cleared in HandleCompleteLogin because the form | 1768 // Test properties are cleared in HandleCompleteLogin because the form |
| 1761 // submission might fail and login will not be attempted after reloading | 1769 // submission might fail and login will not be attempted after reloading |
| 1762 // if they are cleared here. | 1770 // if they are cleared here. |
| 1763 } | 1771 } |
| 1764 | 1772 |
| 1765 } // namespace chromeos | 1773 } // namespace chromeos |
| OLD | NEW |