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

Unified Diff: chrome/browser/chromeos/system/timezone_resolver_manager.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 | « chrome/browser/chromeos/preferences.cc ('k') | chrome/browser/chromeos/system/timezone_resolver_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/system/timezone_resolver_manager.h
diff --git a/chrome/browser/chromeos/system/timezone_resolver_manager.h b/chrome/browser/chromeos/system/timezone_resolver_manager.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f3c93bce39159b51c8152666c212eef39878f56
--- /dev/null
+++ b/chrome/browser/chromeos/system/timezone_resolver_manager.h
@@ -0,0 +1,52 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_
+#define CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_
+
+#include "base/macros.h"
+#include "chromeos/timezone/timezone_resolver.h"
+#include "components/prefs/pref_change_registrar.h"
+
+class PrefService;
+
+namespace chromeos {
+namespace system {
+
+class TimeZoneResolverManager : public TimeZoneResolver::Delegate {
+ public:
+ TimeZoneResolverManager();
+ ~TimeZoneResolverManager() override;
+
+ // This sets primary_user_prefs_.
+ void SetPrimaryUserPrefs(PrefService* pref_service);
+
+ // TimeZoneResolver::Delegate overrides:
+ bool ShouldSendWiFiGeolocationData() override;
+
+ // Starts or stops TimezoneResolver according to currect settings.
+ void UpdateTimezoneResolver();
+
+ // Returns true if result of timezone resolve should be applied to
+ // system timezone (preferences might have changed since request was started).
+ bool ShouldApplyResolvedTimezone();
+
+ private:
+ // Returns true if TimeZoneResolver should be running and taking in account
+ // all configuration data.
+ bool IsTimeZoneResolverShouldBeRunnig();
+
+ // This is non-null only after user logs in.
+ PrefService* primary_user_prefs_;
+
+ // This is used to subscribe to policy preference.
+ PrefChangeRegistrar local_state_pref_change_registrar_;
+
+ DISALLOW_COPY_AND_ASSIGN(TimeZoneResolverManager);
+};
+
+} // namespace system
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_SYSTEM_TIMEZONE_RESOLVER_MANAGER_H_
« no previous file with comments | « chrome/browser/chromeos/preferences.cc ('k') | chrome/browser/chromeos/system/timezone_resolver_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698