| 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_switches.h" | 45 #include "chrome/common/chrome_switches.h" |
| 45 #include "chrome/common/chrome_version_info.h" | 46 #include "chrome/common/chrome_version_info.h" |
| (...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 | 908 |
| 908 //////////////////////////////////////////////////////////////////////////////// | 909 //////////////////////////////////////////////////////////////////////////////// |
| 909 // ExistingUserController, private: | 910 // ExistingUserController, private: |
| 910 | 911 |
| 911 void ExistingUserController::ActivateWizard(const std::string& screen_name) { | 912 void ExistingUserController::ActivateWizard(const std::string& screen_name) { |
| 912 scoped_ptr<DictionaryValue> params; | 913 scoped_ptr<DictionaryValue> params; |
| 913 host_->StartWizard(screen_name, params.Pass()); | 914 host_->StartWizard(screen_name, params.Pass()); |
| 914 } | 915 } |
| 915 | 916 |
| 916 void ExistingUserController::ConfigurePublicSessionAutoLogin() { | 917 void ExistingUserController::ConfigurePublicSessionAutoLogin() { |
| 917 if (!cros_settings_->GetString( | 918 std::string auto_login_account_id; |
| 918 kAccountsPrefDeviceLocalAccountAutoLoginId, | 919 cros_settings_->GetString(kAccountsPrefDeviceLocalAccountAutoLoginId, |
| 919 &public_session_auto_login_username_)) { | 920 &auto_login_account_id); |
| 920 public_session_auto_login_username_.clear(); | 921 const std::vector<policy::DeviceLocalAccount> device_local_accounts = |
| 922 policy::GetDeviceLocalAccounts(cros_settings_); |
| 923 |
| 924 public_session_auto_login_username_.clear(); |
| 925 for (std::vector<policy::DeviceLocalAccount>::const_iterator |
| 926 it = device_local_accounts.begin(); |
| 927 it != device_local_accounts.end(); ++it) { |
| 928 if (it->account_id == auto_login_account_id) { |
| 929 public_session_auto_login_username_ = it->user_id; |
| 930 break; |
| 931 } |
| 921 } | 932 } |
| 922 | 933 |
| 923 const User* user = | 934 const User* user = |
| 924 UserManager::Get()->FindUser(public_session_auto_login_username_); | 935 UserManager::Get()->FindUser(public_session_auto_login_username_); |
| 925 if (!user || user->GetType() != User::USER_TYPE_PUBLIC_ACCOUNT) | 936 if (!user || user->GetType() != User::USER_TYPE_PUBLIC_ACCOUNT) |
| 926 public_session_auto_login_username_.clear(); | 937 public_session_auto_login_username_.clear(); |
| 927 | 938 |
| 928 if (!cros_settings_->GetInteger( | 939 if (!cros_settings_->GetInteger( |
| 929 kAccountsPrefDeviceLocalAccountAutoLoginDelay, | 940 kAccountsPrefDeviceLocalAccountAutoLoginDelay, |
| 930 &public_session_auto_login_delay_)) { | 941 &public_session_auto_login_delay_)) { |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 // changed. | 1121 // changed. |
| 1111 UserManager::Get()->SaveUserOAuthStatus( | 1122 UserManager::Get()->SaveUserOAuthStatus( |
| 1112 username, | 1123 username, |
| 1113 User::OAUTH2_TOKEN_STATUS_INVALID); | 1124 User::OAUTH2_TOKEN_STATUS_INVALID); |
| 1114 | 1125 |
| 1115 login_display_->SetUIEnabled(true); | 1126 login_display_->SetUIEnabled(true); |
| 1116 login_display_->ShowGaiaPasswordChanged(username); | 1127 login_display_->ShowGaiaPasswordChanged(username); |
| 1117 } | 1128 } |
| 1118 | 1129 |
| 1119 } // namespace chromeos | 1130 } // namespace chromeos |
| OLD | NEW |