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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/bind_helpers.h" | 11 #include "base/bind_helpers.h" |
bartfab (slow)
2014/10/17 09:54:56
Nit: No longer used.
Roger Tawa OOO till Jul 10th
2014/10/20 16:04:00
Done.
| |
12 #include "base/debug/trace_event.h" | 12 #include "base/debug/trace_event.h" |
13 #include "base/location.h" | 13 #include "base/location.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/prefs/pref_registry_simple.h" | 16 #include "base/prefs/pref_registry_simple.h" |
17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
18 #include "base/prefs/scoped_user_pref_update.h" | 18 #include "base/prefs/scoped_user_pref_update.h" |
19 #include "base/strings/string16.h" | 19 #include "base/strings/string16.h" |
20 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
21 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
39 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 39 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
40 #include "chrome/browser/chromeos/login/wizard_controller.h" | 40 #include "chrome/browser/chromeos/login/wizard_controller.h" |
41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 41 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
42 #include "chrome/browser/chromeos/policy/consumer_management_service.h" | 42 #include "chrome/browser/chromeos/policy/consumer_management_service.h" |
43 #include "chrome/browser/chromeos/policy/device_local_account.h" | 43 #include "chrome/browser/chromeos/policy/device_local_account.h" |
44 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 44 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
45 #include "chrome/browser/chromeos/settings/cros_settings.h" | 45 #include "chrome/browser/chromeos/settings/cros_settings.h" |
46 #include "chrome/browser/io_thread.h" | 46 #include "chrome/browser/io_thread.h" |
47 #include "chrome/browser/profiles/profile.h" | 47 #include "chrome/browser/profiles/profile.h" |
48 #include "chrome/browser/signin/easy_unlock_service.h" | 48 #include "chrome/browser/signin/easy_unlock_service.h" |
49 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" | 49 #include "chrome/browser/ui/webui/chromeos/login/authenticated_user_email_retrie ver.h" |
bartfab (slow)
2014/10/17 09:54:56
1: Nit: This file is no longer used here.
2: The A
Roger Tawa OOO till Jul 10th
2014/10/20 16:04:00
Done.
bartfab (slow)
2014/10/21 14:47:46
Please file a bug to remove AuthenticatedUserEmail
| |
50 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" | 50 #include "chrome/browser/ui/webui/chromeos/login/error_screen_handler.h" |
51 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 51 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
52 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" | 52 #include "chrome/browser/ui/webui/chromeos/login/native_window_delegate.h" |
53 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" | 53 #include "chrome/browser/ui/webui/chromeos/login/network_state_informer.h" |
54 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" | 54 #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" |
55 #include "chrome/common/pref_names.h" | 55 #include "chrome/common/pref_names.h" |
56 #include "chrome/common/url_constants.h" | 56 #include "chrome/common/url_constants.h" |
57 #include "chrome/grit/chromium_strings.h" | 57 #include "chrome/grit/chromium_strings.h" |
58 #include "chrome/grit/generated_resources.h" | 58 #include "chrome/grit/generated_resources.h" |
59 #include "chromeos/dbus/dbus_thread_manager.h" | 59 #include "chromeos/dbus/dbus_thread_manager.h" |
60 #include "chromeos/dbus/power_manager_client.h" | 60 #include "chromeos/dbus/power_manager_client.h" |
61 #include "chromeos/ime/ime_keyboard.h" | 61 #include "chromeos/ime/ime_keyboard.h" |
62 #include "chromeos/ime/input_method_descriptor.h" | 62 #include "chromeos/ime/input_method_descriptor.h" |
63 #include "chromeos/ime/input_method_manager.h" | 63 #include "chromeos/ime/input_method_manager.h" |
64 #include "chromeos/login/auth/key.h" | 64 #include "chromeos/login/auth/key.h" |
65 #include "chromeos/login/auth/user_context.h" | 65 #include "chromeos/login/auth/user_context.h" |
66 #include "chromeos/network/network_state.h" | 66 #include "chromeos/network/network_state.h" |
67 #include "chromeos/network/network_state_handler.h" | 67 #include "chromeos/network/network_state_handler.h" |
68 #include "chromeos/network/portal_detector/network_portal_detector.h" | 68 #include "chromeos/network/portal_detector/network_portal_detector.h" |
69 #include "components/user_manager/user.h" | 69 #include "components/user_manager/user.h" |
70 #include "components/user_manager/user_manager.h" | 70 #include "components/user_manager/user_manager.h" |
71 #include "components/user_manager/user_type.h" | 71 #include "components/user_manager/user_type.h" |
72 #include "content/public/browser/render_frame_host.h" | 72 #include "content/public/browser/render_frame_host.h" |
73 #include "content/public/browser/web_contents.h" | 73 #include "content/public/browser/web_contents.h" |
74 #include "google_apis/gaia/gaia_auth_util.h" | 74 #include "google_apis/gaia/gaia_auth_util.h" |
75 #include "net/url_request/url_request_context_getter.h" | 75 #include "net/url_request/url_request_context_getter.h" |
bartfab (slow)
2014/10/17 09:54:56
Nit: No longer used.
Roger Tawa OOO till Jul 10th
2014/10/20 16:04:00
Done.
| |
76 #include "third_party/cros_system_api/dbus/service_constants.h" | 76 #include "third_party/cros_system_api/dbus/service_constants.h" |
77 #include "ui/base/webui/web_ui_util.h" | 77 #include "ui/base/webui/web_ui_util.h" |
78 | 78 |
79 #if defined(USE_AURA) | 79 #if defined(USE_AURA) |
80 #include "ash/shell.h" | 80 #include "ash/shell.h" |
81 #include "ash/wm/lock_state_controller.h" | 81 #include "ash/wm/lock_state_controller.h" |
82 #endif | 82 #endif |
83 | 83 |
84 namespace { | 84 namespace { |
85 | 85 |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
765 AddCallback("loginUIStateChanged", | 765 AddCallback("loginUIStateChanged", |
766 &SigninScreenHandler::HandleLoginUIStateChanged); | 766 &SigninScreenHandler::HandleLoginUIStateChanged); |
767 AddCallback("unlockOnLoginSuccess", | 767 AddCallback("unlockOnLoginSuccess", |
768 &SigninScreenHandler::HandleUnlockOnLoginSuccess); | 768 &SigninScreenHandler::HandleUnlockOnLoginSuccess); |
769 AddCallback("showLoadingTimeoutError", | 769 AddCallback("showLoadingTimeoutError", |
770 &SigninScreenHandler::HandleShowLoadingTimeoutError); | 770 &SigninScreenHandler::HandleShowLoadingTimeoutError); |
771 AddCallback("updateOfflineLogin", | 771 AddCallback("updateOfflineLogin", |
772 &SigninScreenHandler::HandleUpdateOfflineLogin); | 772 &SigninScreenHandler::HandleUpdateOfflineLogin); |
773 AddCallback("focusPod", &SigninScreenHandler::HandleFocusPod); | 773 AddCallback("focusPod", &SigninScreenHandler::HandleFocusPod); |
774 AddCallback("hardlockPod", &SigninScreenHandler::HandleHardlockPod); | 774 AddCallback("hardlockPod", &SigninScreenHandler::HandleHardlockPod); |
775 AddCallback("retrieveAuthenticatedUserEmail", | |
776 &SigninScreenHandler::HandleRetrieveAuthenticatedUserEmail); | |
777 AddCallback("getPublicSessionKeyboardLayouts", | 775 AddCallback("getPublicSessionKeyboardLayouts", |
778 &SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts); | 776 &SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts); |
779 AddCallback("cancelConsumerManagementEnrollment", | 777 AddCallback("cancelConsumerManagementEnrollment", |
780 &SigninScreenHandler::HandleCancelConsumerManagementEnrollment); | 778 &SigninScreenHandler::HandleCancelConsumerManagementEnrollment); |
781 AddCallback("getTouchViewState", | 779 AddCallback("getTouchViewState", |
782 &SigninScreenHandler::HandleGetTouchViewState); | 780 &SigninScreenHandler::HandleGetTouchViewState); |
783 | 781 |
784 | 782 |
785 // This message is sent by the kiosk app menu, but is handled here | 783 // This message is sent by the kiosk app menu, but is handled here |
786 // so we can tell the delegate to launch the app. | 784 // so we can tell the delegate to launch the app. |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1373 void SigninScreenHandler::HandleHardlockPod(const std::string& user_id) { | 1371 void SigninScreenHandler::HandleHardlockPod(const std::string& user_id) { |
1374 SetAuthType(user_id, | 1372 SetAuthType(user_id, |
1375 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, | 1373 ScreenlockBridge::LockHandler::OFFLINE_PASSWORD, |
1376 base::string16()); | 1374 base::string16()); |
1377 EasyUnlockService* service = GetEasyUnlockServiceForUser(user_id); | 1375 EasyUnlockService* service = GetEasyUnlockServiceForUser(user_id); |
1378 if (!service) | 1376 if (!service) |
1379 return; | 1377 return; |
1380 service->SetHardlockState(EasyUnlockScreenlockStateHandler::USER_HARDLOCK); | 1378 service->SetHardlockState(EasyUnlockScreenlockStateHandler::USER_HARDLOCK); |
1381 } | 1379 } |
1382 | 1380 |
1383 void SigninScreenHandler::HandleRetrieveAuthenticatedUserEmail( | |
1384 double attempt_token) { | |
1385 // TODO(antrim) : move GaiaSigninScreen dependency to GaiaSigninScreen. | |
1386 email_retriever_.reset(new AuthenticatedUserEmailRetriever( | |
1387 base::Bind(&SigninScreenHandler::CallJS<double, std::string>, | |
1388 base::Unretained(this), | |
1389 "login.GaiaSigninScreen.setAuthenticatedUserEmail", | |
1390 attempt_token), | |
1391 Profile::FromWebUI(web_ui())->GetRequestContext())); | |
1392 } | |
1393 | |
1394 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( | 1381 void SigninScreenHandler::HandleGetPublicSessionKeyboardLayouts( |
1395 const std::string& user_id, | 1382 const std::string& user_id, |
1396 const std::string& locale) { | 1383 const std::string& locale) { |
1397 GetKeyboardLayoutsForLocale( | 1384 GetKeyboardLayoutsForLocale( |
1398 base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts, | 1385 base::Bind(&SigninScreenHandler::SendPublicSessionKeyboardLayouts, |
1399 weak_factory_.GetWeakPtr(), | 1386 weak_factory_.GetWeakPtr(), |
1400 user_id, | 1387 user_id, |
1401 locale), | 1388 locale), |
1402 locale); | 1389 locale); |
1403 } | 1390 } |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1596 return gaia_screen_handler_->frame_error(); | 1583 return gaia_screen_handler_->frame_error(); |
1597 } | 1584 } |
1598 | 1585 |
1599 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { | 1586 void SigninScreenHandler::OnCapsLockChanged(bool enabled) { |
1600 caps_lock_enabled_ = enabled; | 1587 caps_lock_enabled_ = enabled; |
1601 if (page_is_ready()) | 1588 if (page_is_ready()) |
1602 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); | 1589 CallJS("login.AccountPickerScreen.setCapsLockState", caps_lock_enabled_); |
1603 } | 1590 } |
1604 | 1591 |
1605 } // namespace chromeos | 1592 } // namespace chromeos |
OLD | NEW |