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" |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "chrome/browser/chromeos/cros/cros_library.h" | 26 #include "chrome/browser/chromeos/cros/cros_library.h" |
27 #include "chrome/browser/chromeos/customization_document.h" | 27 #include "chrome/browser/chromeos/customization_document.h" |
28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" | 28 #include "chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings.h" |
29 #include "chrome/browser/chromeos/login/helper.h" | 29 #include "chrome/browser/chromeos/login/helper.h" |
30 #include "chrome/browser/chromeos/login/login_display_host.h" | 30 #include "chrome/browser/chromeos/login/login_display_host.h" |
31 #include "chrome/browser/chromeos/login/login_utils.h" | 31 #include "chrome/browser/chromeos/login/login_utils.h" |
32 #include "chrome/browser/chromeos/login/startup_utils.h" | 32 #include "chrome/browser/chromeos/login/startup_utils.h" |
33 #include "chrome/browser/chromeos/login/user_manager.h" | 33 #include "chrome/browser/chromeos/login/user_manager.h" |
34 #include "chrome/browser/chromeos/login/wizard_controller.h" | 34 #include "chrome/browser/chromeos/login/wizard_controller.h" |
35 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" | 35 #include "chrome/browser/chromeos/net/connectivity_state_helper.h" |
36 #include "chrome/browser/chromeos/policy/device_local_account.h" | |
36 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 37 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
37 #include "chrome/browser/chromeos/settings/cros_settings.h" | 38 #include "chrome/browser/chromeos/settings/cros_settings.h" |
38 #include "chrome/browser/chromeos/settings/cros_settings_names.h" | 39 #include "chrome/browser/chromeos/settings/cros_settings_names.h" |
39 #include "chrome/browser/chromeos/system/statistics_provider.h" | 40 #include "chrome/browser/chromeos/system/statistics_provider.h" |
40 #include "chrome/browser/google/google_util.h" | 41 #include "chrome/browser/google/google_util.h" |
41 #include "chrome/browser/policy/policy_service.h" | 42 #include "chrome/browser/policy/policy_service.h" |
42 #include "chrome/browser/prefs/session_startup_pref.h" | 43 #include "chrome/browser/prefs/session_startup_pref.h" |
43 #include "chrome/common/chrome_notification_types.h" | 44 #include "chrome/common/chrome_notification_types.h" |
44 #include "chrome/common/chrome_version_info.h" | 45 #include "chrome/common/chrome_version_info.h" |
45 #include "chrome/common/pref_names.h" | 46 #include "chrome/common/pref_names.h" |
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
891 } | 892 } |
892 | 893 |
893 //////////////////////////////////////////////////////////////////////////////// | 894 //////////////////////////////////////////////////////////////////////////////// |
894 // ExistingUserController, private: | 895 // ExistingUserController, private: |
895 | 896 |
896 void ExistingUserController::ActivateWizard(const std::string& screen_name) { | 897 void ExistingUserController::ActivateWizard(const std::string& screen_name) { |
897 scoped_ptr<DictionaryValue> params; | 898 scoped_ptr<DictionaryValue> params; |
898 host_->StartWizard(screen_name, params.Pass()); | 899 host_->StartWizard(screen_name, params.Pass()); |
899 } | 900 } |
900 | 901 |
901 void ExistingUserController::ConfigurePublicSessionAutoLogin() { | 902 void ExistingUserController::ConfigurePublicSessionAutoLogin() { |
Mattias Nissler (ping if slow)
2013/05/15 09:38:47
Hm, maybe a better approach for this would be to p
bartfab (slow)
2013/05/17 11:14:28
I don't think that would be right. Auto-login is n
Mattias Nissler (ping if slow)
2013/05/17 14:29:44
What I'm saying is that ExistingUserController sho
bartfab (slow)
2013/05/17 16:08:47
A near-term goal is to create User objects for all
| |
902 if (!cros_settings_->GetString( | 903 std::string auto_login_account_id; |
903 kAccountsPrefDeviceLocalAccountAutoLoginId, | 904 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, |
904 &public_session_auto_login_username_)) { | 905 &auto_login_account_id); |
905 public_session_auto_login_username_.clear(); | 906 |
907 const base::ListValue* device_local_accounts_list; | |
908 cros_settings_->GetList(kAccountsPrefDeviceLocalAccounts, | |
909 &device_local_accounts_list); | |
910 const std::vector<policy::DeviceLocalAccount> device_local_accounts = | |
911 policy::DecodeDeviceLocalAccountsList(device_local_accounts_list); | |
912 | |
913 public_session_auto_login_username_.clear(); | |
914 for (std::vector<policy::DeviceLocalAccount>::const_iterator | |
915 it = device_local_accounts.begin(); | |
916 it != device_local_accounts.end(); ++it) { | |
917 if (it->account_id == auto_login_account_id) { | |
918 public_session_auto_login_username_ = it->user_id; | |
919 break; | |
920 } | |
906 } | 921 } |
907 | 922 |
908 const User* user = | 923 const User* user = |
909 UserManager::Get()->FindUser(public_session_auto_login_username_); | 924 UserManager::Get()->FindUser(public_session_auto_login_username_); |
910 if (!user || user->GetType() != User::USER_TYPE_PUBLIC_ACCOUNT) | 925 if (!user || user->GetType() != User::USER_TYPE_PUBLIC_ACCOUNT) |
911 public_session_auto_login_username_.clear(); | 926 public_session_auto_login_username_.clear(); |
912 | 927 |
913 if (!cros_settings_->GetInteger( | 928 if (!cros_settings_->GetInteger( |
914 kAccountsPrefDeviceLocalAccountAutoLoginDelay, | 929 kAccountsPrefDeviceLocalAccountAutoLoginDelay, |
915 &public_session_auto_login_delay_)) { | 930 &public_session_auto_login_delay_)) { |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1086 // changed. | 1101 // changed. |
1087 UserManager::Get()->SaveUserOAuthStatus( | 1102 UserManager::Get()->SaveUserOAuthStatus( |
1088 username, | 1103 username, |
1089 User::OAUTH2_TOKEN_STATUS_INVALID); | 1104 User::OAUTH2_TOKEN_STATUS_INVALID); |
1090 | 1105 |
1091 login_display_->SetUIEnabled(true); | 1106 login_display_->SetUIEnabled(true); |
1092 login_display_->ShowGaiaPasswordChanged(username); | 1107 login_display_->ShowGaiaPasswordChanged(username); |
1093 } | 1108 } |
1094 | 1109 |
1095 } // namespace chromeos | 1110 } // namespace chromeos |
OLD | NEW |