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

Unified Diff: chromeos/timezone/timezone_resolver.h

Issue 1836433003: ChromeOS: Add SystemTimezoneAutomaticDetection policy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | chromeos/timezone/timezone_resolver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/timezone/timezone_resolver.h
diff --git a/chromeos/timezone/timezone_resolver.h b/chromeos/timezone/timezone_resolver.h
index 35e6c2e792b28e93f665cc5504453b7fd6b60cf1..2ae2d322a4770c53da57bf380b13b641713322b0 100644
--- a/chromeos/timezone/timezone_resolver.h
+++ b/chromeos/timezone/timezone_resolver.h
@@ -32,11 +32,24 @@ class CHROMEOS_EXPORT TimeZoneResolver {
// restrictions.
using DelayNetworkCallClosure = base::Callback<void(const base::Closure&)>;
+ class Delegate {
+ public:
+ Delegate();
+ virtual ~Delegate();
+
+ // Returns true if TimeZoneResolver should include WiFi data in request.
+ virtual bool ShouldSendWiFiGeolocationData() = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(Delegate);
+ };
+
// This is a LocalState preference to store base::Time value of the last
// request. It is used to limit request rate on browser restart.
static const char kLastTimeZoneRefreshTime[];
- TimeZoneResolver(scoped_refptr<net::URLRequestContextGetter> context,
+ TimeZoneResolver(Delegate* delegate,
+ scoped_refptr<net::URLRequestContextGetter> context,
const GURL& url,
const ApplyTimeZoneCallback& apply_timezone,
const DelayNetworkCallClosure& delay_network_call,
@@ -64,12 +77,17 @@ class CHROMEOS_EXPORT TimeZoneResolver {
PrefService* local_state() const { return local_state_; }
+ // Proxy call to Delegate::ShouldSendWiFiGeolocationData().
+ bool ShouldSendWiFiGeolocationData() const;
+
// Expose internal fuctions for testing.
static int MaxRequestsCountForIntervalForTesting(
const double interval_seconds);
static int IntervalForNextRequestForTesting(const int requests);
private:
+ Delegate* delegate_;
+
scoped_refptr<net::URLRequestContextGetter> context_;
const GURL url_;
« no previous file with comments | « chromeos/chromeos_switches.cc ('k') | chromeos/timezone/timezone_resolver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698