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

Unified Diff: chromeos/timezone/timezone_resolver.cc

Issue 2624843003: Add support for cellular geolocation (Closed)
Patch Set: Update device tests to use correct dict key Created 3 years, 10 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
« no previous file with comments | « chromeos/timezone/timezone_resolver.h ('k') | components/policy/resources/policy_templates.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/timezone/timezone_resolver.cc
diff --git a/chromeos/timezone/timezone_resolver.cc b/chromeos/timezone/timezone_resolver.cc
index 28790c30a197cefc8aaf6fc2793e2c96de767a73..68795f850302f502ac3e933935ea090e350534e0 100644
--- a/chromeos/timezone/timezone_resolver.cc
+++ b/chromeos/timezone/timezone_resolver.cc
@@ -119,10 +119,14 @@ class TimeZoneResolver::TimeZoneResolverImpl : public base::PowerObserver {
base::WeakPtr<TimeZoneResolver::TimeZoneResolverImpl> AsWeakPtr();
bool ShouldSendWiFiGeolocationData();
+ bool ShouldSendCellularGeolocationData();
private:
const TimeZoneResolver* resolver_;
+ // Helper to check timezone detection policy against expected value
+ bool CheckTimezoneManagementSetting(int expected_policy_value);
+
// Returns delay to next timezone update request
base::TimeDelta CalculateNextInterval();
@@ -186,6 +190,7 @@ void TZRequest::StartRequestOnNetworkAvailable() {
resolver_->geolocation_provider()->RequestGeolocation(
base::TimeDelta::FromSeconds(kRefreshTimeZoneTimeoutSeconds),
resolver_->ShouldSendWiFiGeolocationData(),
+ resolver_->ShouldSendCellularGeolocationData(),
base::Bind(&TZRequest::OnLocationResolved, AsWeakPtr()));
}
@@ -373,6 +378,11 @@ bool TimeZoneResolver::TimeZoneResolverImpl::ShouldSendWiFiGeolocationData() {
return resolver_->ShouldSendWiFiGeolocationData();
}
+bool TimeZoneResolver::TimeZoneResolverImpl::
+ ShouldSendCellularGeolocationData() {
+ return resolver_->ShouldSendCellularGeolocationData();
+}
+
base::WeakPtr<TimeZoneResolver::TimeZoneResolverImpl>
TimeZoneResolver::TimeZoneResolverImpl::AsWeakPtr() {
return weak_ptr_factory_.GetWeakPtr();
@@ -440,4 +450,8 @@ bool TimeZoneResolver::ShouldSendWiFiGeolocationData() const {
return delegate_->ShouldSendWiFiGeolocationData();
}
+bool TimeZoneResolver::ShouldSendCellularGeolocationData() const {
+ return delegate_->ShouldSendCellularGeolocationData();
+}
+
} // namespace chromeos
« no previous file with comments | « chromeos/timezone/timezone_resolver.h ('k') | components/policy/resources/policy_templates.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698