| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/system/timezone_resolver_manager.h" | 5 #include "chrome/browser/chromeos/system/timezone_resolver_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" | 10 #include "chrome/browser/chromeos/policy/proto/chrome_device_policy.pb.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 bool TimeZoneResolverManager::ShouldApplyResolvedTimezone() { | 154 bool TimeZoneResolverManager::ShouldApplyResolvedTimezone() { |
| 155 return TimeZoneResolverShouldBeRunning(); | 155 return TimeZoneResolverShouldBeRunning(); |
| 156 } | 156 } |
| 157 | 157 |
| 158 bool TimeZoneResolverManager::TimeZoneResolverShouldBeRunningForTests() { | 158 bool TimeZoneResolverManager::TimeZoneResolverShouldBeRunningForTests() { |
| 159 return TimeZoneResolverShouldBeRunning(); | 159 return TimeZoneResolverShouldBeRunning(); |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool TimeZoneResolverManager::TimeZoneResolverShouldBeRunning() { | 162 bool TimeZoneResolverManager::TimeZoneResolverShouldBeRunning() { |
| 163 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 164 chromeos::switches::kDisableTimeZoneTrackingOption)) { | |
| 165 return false; | |
| 166 } | |
| 167 ServiceConfiguration result = GetServiceConfigurationFromPolicy(); | 163 ServiceConfiguration result = GetServiceConfigurationFromPolicy(); |
| 168 | 164 |
| 169 if (result == UNSPECIFIED) { | 165 if (result == UNSPECIFIED) { |
| 170 if (primary_user_prefs_) { | 166 if (primary_user_prefs_) { |
| 171 result = GetServiceConfigurationFromUserPrefs(primary_user_prefs_); | 167 result = GetServiceConfigurationFromUserPrefs(primary_user_prefs_); |
| 172 } else { | 168 } else { |
| 173 // We are on a signin page. | 169 // We are on a signin page. |
| 174 result = GetServiceConfigurationForSigninScreen(); | 170 result = GetServiceConfigurationForSigninScreen(); |
| 175 } | 171 } |
| 176 } | 172 } |
| 177 return result == SHOULD_START; | 173 return result == SHOULD_START; |
| 178 } | 174 } |
| 179 | 175 |
| 180 } // namespace system | 176 } // namespace system |
| 181 } // namespace chromeos | 177 } // namespace chromeos |
| OLD | NEW |