| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/users/chrome_user_manager_impl.h" | 5 #include "chrome/browser/chromeos/login/users/chrome_user_manager_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <cstddef> | 8 #include <cstddef> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" | 36 #include "chrome/browser/chromeos/login/users/default_user_image/default_user_im
ages.h" |
| 37 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 37 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 38 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" | 38 #include "chrome/browser/chromeos/login/users/supervised_user_manager_impl.h" |
| 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/policy/browser_policy_connector_chromeos.h" | 40 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 41 #include "chrome/browser/chromeos/policy/device_local_account.h" | 41 #include "chrome/browser/chromeos/policy/device_local_account.h" |
| 42 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" | 42 #include "chrome/browser/chromeos/profiles/multiprofiles_session_aborted_dialog.
h" |
| 43 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 43 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 44 #include "chrome/browser/chromeos/session_length_limiter.h" | 44 #include "chrome/browser/chromeos/session_length_limiter.h" |
| 45 #include "chrome/browser/chromeos/settings/cros_settings.h" | 45 #include "chrome/browser/chromeos/settings/cros_settings.h" |
| 46 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" |
| 46 #include "chrome/browser/chromeos/system/timezone_util.h" | 47 #include "chrome/browser/chromeos/system/timezone_util.h" |
| 47 #include "chrome/browser/profiles/profile.h" | 48 #include "chrome/browser/profiles/profile.h" |
| 48 #include "chrome/browser/signin/easy_unlock_service.h" | 49 #include "chrome/browser/signin/easy_unlock_service.h" |
| 49 #include "chrome/browser/supervised_user/chromeos/manager_password_service_facto
ry.h" | 50 #include "chrome/browser/supervised_user/chromeos/manager_password_service_facto
ry.h" |
| 50 #include "chrome/browser/supervised_user/chromeos/supervised_user_password_servi
ce_factory.h" | 51 #include "chrome/browser/supervised_user/chromeos/supervised_user_password_servi
ce_factory.h" |
| 51 #include "chrome/common/chrome_constants.h" | 52 #include "chrome/common/chrome_constants.h" |
| 52 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
| 53 #include "chrome/common/crash_keys.h" | 54 #include "chrome/common/crash_keys.h" |
| 54 #include "chrome/common/pref_names.h" | 55 #include "chrome/common/pref_names.h" |
| 55 #include "chrome/grit/theme_resources.h" | 56 #include "chrome/grit/theme_resources.h" |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1163 if (!IsUserLoggedIn()) | 1164 if (!IsUserLoggedIn()) |
| 1164 return; | 1165 return; |
| 1165 | 1166 |
| 1166 // Timezone auto refresh is disabled for Guest, Supervized and OffTheRecord | 1167 // Timezone auto refresh is disabled for Guest, Supervized and OffTheRecord |
| 1167 // users, but enabled for Kiosk mode. | 1168 // users, but enabled for Kiosk mode. |
| 1168 if (IsLoggedInAsGuest() || IsLoggedInAsSupervisedUser() || | 1169 if (IsLoggedInAsGuest() || IsLoggedInAsSupervisedUser() || |
| 1169 profile->IsOffTheRecord()) { | 1170 profile->IsOffTheRecord()) { |
| 1170 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); | 1171 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); |
| 1171 return; | 1172 return; |
| 1172 } | 1173 } |
| 1173 | 1174 g_browser_process->platform_part() |
| 1174 if (profile->GetPrefs()->GetBoolean(prefs::kResolveTimezoneByGeolocation) && | 1175 ->GetTimezoneResolverManager() |
| 1175 !system::HasSystemTimezonePolicy()) { | 1176 ->UpdateTimezoneResolver(); |
| 1176 g_browser_process->platform_part()->GetTimezoneResolver()->Start(); | |
| 1177 } else { | |
| 1178 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); | |
| 1179 } | |
| 1180 } | 1177 } |
| 1181 | 1178 |
| 1182 void ChromeUserManagerImpl::SetUserAffiliation( | 1179 void ChromeUserManagerImpl::SetUserAffiliation( |
| 1183 const std::string& user_email, | 1180 const std::string& user_email, |
| 1184 const AffiliationIDSet& user_affiliation_ids) { | 1181 const AffiliationIDSet& user_affiliation_ids) { |
| 1185 const AccountId& account_id = | 1182 const AccountId& account_id = |
| 1186 user_manager::known_user::GetAccountId(user_email, std::string()); | 1183 user_manager::known_user::GetAccountId(user_email, std::string()); |
| 1187 user_manager::User* user = FindUserAndModify(account_id); | 1184 user_manager::User* user = FindUserAndModify(account_id); |
| 1188 | 1185 |
| 1189 if (user) { | 1186 if (user) { |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1295 base::Bind(ResolveLocale, locale, base::Unretained(out_resolved_locale)), | 1292 base::Bind(ResolveLocale, locale, base::Unretained(out_resolved_locale)), |
| 1296 on_resolved_callback); | 1293 on_resolved_callback); |
| 1297 } | 1294 } |
| 1298 | 1295 |
| 1299 bool ChromeUserManagerImpl::IsValidDefaultUserImageId(int image_index) const { | 1296 bool ChromeUserManagerImpl::IsValidDefaultUserImageId(int image_index) const { |
| 1300 return image_index >= 0 && | 1297 return image_index >= 0 && |
| 1301 image_index < chromeos::default_user_image::kDefaultImagesCount; | 1298 image_index < chromeos::default_user_image::kDefaultImagesCount; |
| 1302 } | 1299 } |
| 1303 | 1300 |
| 1304 } // namespace chromeos | 1301 } // namespace chromeos |
| OLD | NEW |