Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(43)

Unified Diff: chromeos/timezone/timezone_resolver.cc

Issue 1836433003: ChromeOS: Add SystemTimezoneAutomaticDetection policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/timezone/timezone_resolver.cc
diff --git a/chromeos/timezone/timezone_resolver.cc b/chromeos/timezone/timezone_resolver.cc
index 9e4c7b9a26b627b101db4526f2f7a607f5749bd8..6454fd81afe0742806fc9754463cdb76c4f702f2 100644
--- a/chromeos/timezone/timezone_resolver.cc
+++ b/chromeos/timezone/timezone_resolver.cc
@@ -118,6 +118,8 @@ class TimeZoneResolver::TimeZoneResolverImpl : public base::PowerObserver {
base::WeakPtr<TimeZoneResolver::TimeZoneResolverImpl> AsWeakPtr();
+ bool ShouldSendWiFiGeolocationData();
+
private:
const TimeZoneResolver* resolver_;
@@ -183,7 +185,7 @@ void TZRequest::StartRequestOnNetworkAvailable() {
resolver_->RecordAttempt();
resolver_->geolocation_provider()->RequestGeolocation(
base::TimeDelta::FromSeconds(kRefreshTimeZoneTimeoutSeconds),
- false /* send_wifi_geolocation_data */,
+ resolver_->ShouldSendWiFiGeolocationData(),
stevenjb 2016/03/28 23:23:18 just ShouldSendWiFiGeolocationData() ?
Alexander Alekseev 2016/03/29 00:29:26 TZRequest doesn't have ShouldSendWiFiGeolocationDa
base::Bind(&TZRequest::OnLocationResolved, AsWeakPtr()));
}
@@ -366,21 +368,32 @@ void TimeZoneResolver::TimeZoneResolverImpl::ApplyTimeZone(
resolver_->apply_timezone().Run(timezone);
}
+bool TimeZoneResolver::TimeZoneResolverImpl::ShouldSendWiFiGeolocationData() {
+ return resolver_->ShouldSendWiFiGeolocationData();
+}
+
base::WeakPtr<TimeZoneResolver::TimeZoneResolverImpl>
TimeZoneResolver::TimeZoneResolverImpl::AsWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
}
// ------------------------------------------------------------------------
+// TimeZoneResolver::Delegate implementation
+TimeZoneResolver::Delegate::Delegate() {}
+TimeZoneResolver::Delegate::~Delegate() {}
+
+// ------------------------------------------------------------------------
// TimeZoneResolver implementation
TimeZoneResolver::TimeZoneResolver(
+ Delegate* delegate,
scoped_refptr<net::URLRequestContextGetter> context,
const GURL& url,
const ApplyTimeZoneCallback& apply_timezone,
const DelayNetworkCallClosure& delay_network_call,
PrefService* local_state)
- : context_(context),
+ : delegate_(delegate),
+ context_(context),
url_(url),
apply_timezone_(apply_timezone),
delay_network_call_(delay_network_call),
@@ -422,4 +435,9 @@ void TimeZoneResolver::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterInt64Pref(kLastTimeZoneRefreshTime, 0);
}
+bool TimeZoneResolver::ShouldSendWiFiGeolocationData() const {
+ DCHECK(delegate_);
+ return delegate_->ShouldSendWiFiGeolocationData();
+}
+
} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698