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 <cstddef> | 7 #include <cstddef> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "ash/multi_profile_uma.h" | 10 #include "ash/multi_profile_uma.h" |
(...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1052 crash_keys::kNumberOfUsers, | 1052 crash_keys::kNumberOfUsers, |
1053 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); | 1053 base::StringPrintf("%" PRIuS, GetLoggedInUsers().size())); |
1054 } | 1054 } |
1055 | 1055 |
1056 void ChromeUserManagerImpl::UpdateUserTimeZoneRefresher(Profile* profile) { | 1056 void ChromeUserManagerImpl::UpdateUserTimeZoneRefresher(Profile* profile) { |
1057 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1057 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1058 chromeos::switches::kDisableTimeZoneTrackingOption)) { | 1058 chromeos::switches::kDisableTimeZoneTrackingOption)) { |
1059 return; | 1059 return; |
1060 } | 1060 } |
1061 | 1061 |
1062 user_manager::User* user = ProfileHelper::Get()->GetUserByProfile(profile); | 1062 const user_manager::User* user = |
| 1063 ProfileHelper::Get()->GetUserByProfile(profile); |
1063 if (user == NULL) | 1064 if (user == NULL) |
1064 return; | 1065 return; |
1065 | 1066 |
1066 // In Multi-Profile mode only primary user settings are in effect. | 1067 // In Multi-Profile mode only primary user settings are in effect. |
1067 if (user != user_manager::UserManager::Get()->GetPrimaryUser()) | 1068 if (user != user_manager::UserManager::Get()->GetPrimaryUser()) |
1068 return; | 1069 return; |
1069 | 1070 |
1070 if (!IsUserLoggedIn()) | 1071 if (!IsUserLoggedIn()) |
1071 return; | 1072 return; |
1072 | 1073 |
1073 // Timezone auto refresh is disabled for Guest, Supervized and OffTheRecord | 1074 // Timezone auto refresh is disabled for Guest, Supervized and OffTheRecord |
1074 // users, but enabled for Kiosk mode. | 1075 // users, but enabled for Kiosk mode. |
1075 if (IsLoggedInAsGuest() || IsLoggedInAsSupervisedUser() || | 1076 if (IsLoggedInAsGuest() || IsLoggedInAsSupervisedUser() || |
1076 profile->IsOffTheRecord()) { | 1077 profile->IsOffTheRecord()) { |
1077 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); | 1078 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); |
1078 return; | 1079 return; |
1079 } | 1080 } |
1080 | 1081 |
1081 if (profile->GetPrefs()->GetBoolean(prefs::kResolveTimezoneByGeolocation) && | 1082 if (profile->GetPrefs()->GetBoolean(prefs::kResolveTimezoneByGeolocation) && |
1082 !system::HasSystemTimezonePolicy()) { | 1083 !system::HasSystemTimezonePolicy()) { |
1083 g_browser_process->platform_part()->GetTimezoneResolver()->Start(); | 1084 g_browser_process->platform_part()->GetTimezoneResolver()->Start(); |
1084 } else { | 1085 } else { |
1085 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); | 1086 g_browser_process->platform_part()->GetTimezoneResolver()->Stop(); |
1086 } | 1087 } |
1087 } | 1088 } |
1088 | 1089 |
1089 } // namespace chromeos | 1090 } // namespace chromeos |
OLD | NEW |