Chromium Code Reviews| 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/existing_user_controller.h" | 5 #include "chrome/browser/chromeos/login/existing_user_controller.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 16 #include "base/metrics/histogram.h" | 16 #include "base/metrics/histogram.h" |
| 17 #include "base/prefs/pref_service.h" | 17 #include "base/prefs/pref_service.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "base/version.h" | 21 #include "base/version.h" |
| 22 #include "chrome/browser/accessibility/accessibility_events.h" | 22 #include "chrome/browser/accessibility/accessibility_events.h" |
| 23 #include "chrome/browser/browser_process.h" | 23 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/browser/browser_process_platform_part.h" | 24 #include "chrome/browser/browser_process_platform_part.h" |
| 25 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
| 26 #include "chrome/browser/chromeos/boot_times_loader.h" | 26 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 27 #include "chrome/browser/chromeos/customization/customization_document.h" | 27 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | |
| 29 #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h" | 28 #include "chrome/browser/chromeos/login/auth/chrome_login_performer.h" |
| 30 #include "chrome/browser/chromeos/login/helper.h" | 29 #include "chrome/browser/chromeos/login/helper.h" |
| 31 #include "chrome/browser/chromeos/login/login_utils.h" | 30 #include "chrome/browser/chromeos/login/login_utils.h" |
| 32 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 31 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 33 #include "chrome/browser/chromeos/login/signin_specifics.h" | 32 #include "chrome/browser/chromeos/login/signin_specifics.h" |
| 34 #include "chrome/browser/chromeos/login/startup_utils.h" | 33 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 35 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 34 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 36 #include "chrome/browser/chromeos/login/user_flow.h" | 35 #include "chrome/browser/chromeos/login/user_flow.h" |
| 37 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 36 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 38 #include "chrome/browser/chromeos/login/wizard_controller.h" | 37 #include "chrome/browser/chromeos/login/wizard_controller.h" |
| 39 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 38 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 40 #include "chrome/browser/chromeos/policy/device_local_account.h" | 39 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 41 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 40 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
| 42 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 41 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 43 #include "chrome/browser/chromeos/settings/cros_settings.h" | 42 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 44 #include "chrome/browser/chromeos/system/device_disabling_manager.h" | 43 #include "chrome/browser/chromeos/system/device_disabling_manager.h" |
| 45 #include "chrome/browser/signin/easy_unlock_service.h" | 44 #include "chrome/browser/signin/easy_unlock_service.h" |
| 46 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" | 45 #include "chrome/browser/ui/webui/chromeos/login/l10n_util.h" |
| 47 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
| 48 #include "chrome/common/chrome_version_info.h" | 47 #include "chrome/common/chrome_version_info.h" |
| 49 #include "chrome/common/url_constants.h" | 48 #include "chrome/common/url_constants.h" |
| 50 #include "chrome/grit/generated_resources.h" | 49 #include "chrome/grit/generated_resources.h" |
| 51 #include "chromeos/chromeos_switches.h" | 50 #include "chromeos/chromeos_switches.h" |
| 52 #include "chromeos/dbus/dbus_thread_manager.h" | 51 #include "chromeos/dbus/dbus_thread_manager.h" |
| 53 #include "chromeos/dbus/power_manager_client.h" | 52 #include "chromeos/dbus/power_manager_client.h" |
| 54 #include "chromeos/dbus/session_manager_client.h" | 53 #include "chromeos/dbus/session_manager_client.h" |
| 55 #include "chromeos/login/user_names.h" | 54 #include "chromeos/login/user_names.h" |
| 56 #include "chromeos/settings/cros_settings_names.h" | |
|
bartfab (slow)
2014/12/15 16:08:40
Why are you removing this?
rkc
2014/12/15 20:45:58
Not sure, might be another merge fail. I put it ba
| |
| 57 #include "components/google/core/browser/google_util.h" | 55 #include "components/google/core/browser/google_util.h" |
| 58 #include "components/policy/core/common/cloud/cloud_policy_core.h" | 56 #include "components/policy/core/common/cloud/cloud_policy_core.h" |
| 59 #include "components/policy/core/common/cloud/cloud_policy_store.h" | 57 #include "components/policy/core/common/cloud/cloud_policy_store.h" |
| 60 #include "components/policy/core/common/policy_map.h" | 58 #include "components/policy/core/common/policy_map.h" |
| 61 #include "components/policy/core/common/policy_service.h" | 59 #include "components/policy/core/common/policy_service.h" |
| 62 #include "components/policy/core/common/policy_types.h" | 60 #include "components/policy/core/common/policy_types.h" |
| 63 #include "components/user_manager/user_manager.h" | 61 #include "components/user_manager/user_manager.h" |
| 64 #include "components/user_manager/user_type.h" | 62 #include "components/user_manager/user_type.h" |
| 65 #include "content/public/browser/browser_thread.h" | 63 #include "content/public/browser/browser_thread.h" |
| 66 #include "content/public/browser/notification_service.h" | 64 #include "content/public/browser/notification_service.h" |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 } | 436 } |
| 439 LoginAsGuest(); | 437 LoginAsGuest(); |
| 440 return; | 438 return; |
| 441 } | 439 } |
| 442 | 440 |
| 443 if (user_context.GetUserType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT) { | 441 if (user_context.GetUserType() == user_manager::USER_TYPE_PUBLIC_ACCOUNT) { |
| 444 LoginAsPublicSession(user_context); | 442 LoginAsPublicSession(user_context); |
| 445 return; | 443 return; |
| 446 } | 444 } |
| 447 | 445 |
| 448 if (user_context.GetUserType() == user_manager::USER_TYPE_RETAIL_MODE) { | |
| 449 LoginAsRetailModeUser(); | |
| 450 return; | |
| 451 } | |
| 452 | |
| 453 if (user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP) { | 446 if (user_context.GetUserType() == user_manager::USER_TYPE_KIOSK_APP) { |
| 454 LoginAsKioskApp(user_context.GetUserID(), specifics.kiosk_diagnostic_mode); | 447 LoginAsKioskApp(user_context.GetUserID(), specifics.kiosk_diagnostic_mode); |
| 455 return; | 448 return; |
| 456 } | 449 } |
| 457 | 450 |
| 458 // Regular user or supervised user login. | 451 // Regular user or supervised user login. |
| 459 | 452 |
| 460 if (!user_context.HasCredentials()) { | 453 if (!user_context.HasCredentials()) { |
| 461 // If credentials are missing, refuse to log in. | 454 // If credentials are missing, refuse to log in. |
| 462 | 455 |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 848 return auth_mode_; | 841 return auth_mode_; |
| 849 } | 842 } |
| 850 | 843 |
| 851 bool ExistingUserController::password_changed() const { | 844 bool ExistingUserController::password_changed() const { |
| 852 if (login_performer_) | 845 if (login_performer_) |
| 853 return login_performer_->password_changed(); | 846 return login_performer_->password_changed(); |
| 854 | 847 |
| 855 return password_changed_; | 848 return password_changed_; |
| 856 } | 849 } |
| 857 | 850 |
| 858 void ExistingUserController::LoginAsRetailModeUser() { | |
| 859 PerformPreLoginActions(UserContext(user_manager::USER_TYPE_RETAIL_MODE, | |
| 860 chromeos::login::kRetailModeUserName)); | |
| 861 | |
| 862 // TODO(rkc): Add a CHECK to make sure retail mode logins are allowed once | |
| 863 // the enterprise policy wiring is done for retail mode. | |
| 864 | |
| 865 // Only one instance of LoginPerformer should exist at a time. | |
| 866 login_performer_.reset(NULL); | |
| 867 login_performer_.reset(new ChromeLoginPerformer(this)); | |
| 868 login_performer_->LoginRetailMode(); | |
| 869 SendAccessibilityAlert( | |
| 870 l10n_util::GetStringUTF8(IDS_CHROMEOS_ACC_LOGIN_SIGNIN_DEMOUSER)); | |
| 871 } | |
| 872 | |
| 873 void ExistingUserController::LoginAsGuest() { | 851 void ExistingUserController::LoginAsGuest() { |
| 874 PerformPreLoginActions(UserContext(user_manager::USER_TYPE_GUEST, | 852 PerformPreLoginActions(UserContext(user_manager::USER_TYPE_GUEST, |
| 875 chromeos::login::kGuestUserName)); | 853 chromeos::login::kGuestUserName)); |
| 876 | 854 |
| 877 bool allow_guest; | 855 bool allow_guest; |
| 878 cros_settings_->GetBoolean(kAccountsPrefAllowGuest, &allow_guest); | 856 cros_settings_->GetBoolean(kAccountsPrefAllowGuest, &allow_guest); |
| 879 if (!allow_guest) { | 857 if (!allow_guest) { |
| 880 // Disallowed. The UI should normally not show the guest pod but if for some | 858 // Disallowed. The UI should normally not show the guest pod but if for some |
| 881 // reason this has been made available to the user here is the time to tell | 859 // reason this has been made available to the user here is the time to tell |
| 882 // this nicely. | 860 // this nicely. |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1163 is_login_in_progress_ = false; | 1141 is_login_in_progress_ = false; |
| 1164 | 1142 |
| 1165 // Reenable clicking on other windows and status area. | 1143 // Reenable clicking on other windows and status area. |
| 1166 login_display_->SetUIEnabled(true); | 1144 login_display_->SetUIEnabled(true); |
| 1167 | 1145 |
| 1168 if (start_public_session_timer) | 1146 if (start_public_session_timer) |
| 1169 StartPublicSessionAutoLoginTimer(); | 1147 StartPublicSessionAutoLoginTimer(); |
| 1170 } | 1148 } |
| 1171 | 1149 |
| 1172 } // namespace chromeos | 1150 } // namespace chromeos |
| OLD | NEW |