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

Unified Diff: chrome/browser/chromeos/login/ui/login_display_host_impl.cc

Issue 834073002: ChromeOS: Implement periodic timezone refresh on geolocation data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix rebase. Created 5 years, 11 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: chrome/browser/chromeos/login/ui/login_display_host_impl.cc
diff --git a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
index e79f4083a75a81564e13d229be76230a00c193ca..0f64d5ffe65041649a575db0dfb5f24c5c25b9b1 100644
--- a/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
+++ b/chrome/browser/chromeos/login/ui/login_display_host_impl.cc
@@ -50,6 +50,7 @@
#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
#include "chrome/browser/chromeos/policy/enrollment_config.h"
#include "chrome/browser/chromeos/system/input_device_settings.h"
+#include "chrome/browser/chromeos/system/timezone_util.h"
#include "chrome/browser/chromeos/ui/focus_ring_controller.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -65,6 +66,7 @@
#include "chromeos/dbus/session_manager_client.h"
#include "chromeos/login/login_state.h"
#include "chromeos/settings/timezone_settings.h"
+#include "chromeos/timezone/timezone_resolver.h"
#include "components/session_manager/core/session_manager.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/notification_service.h"
@@ -1087,6 +1089,29 @@ void LoginDisplayHostImpl::OnLoginPromptVisible() {
TryToPlayStartupSound();
}
+void LoginDisplayHostImpl::StartTimeZoneResolve() {
+ if (!base::CommandLine::ForCurrentProcess()->HasSwitch(
+ chromeos::switches::kEnableTimeZoneTrackingOption)) {
+ return;
+ }
+
+ if (!g_browser_process->local_state()->GetBoolean(
+ prefs::kResolveDeviceTimezoneByGeolocation)) {
+ return;
+ }
+
+ if (system::HasSystemTimezonePolicy())
+ return;
+
+ // Do not start resolver if we are inside active user session.
+ // If user preferences permit, it will be started on preferences
+ // initialization.
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginUser))
+ return;
+
+ g_browser_process->platform_part()->GetTimezoneResolver()->Start();
+}
+
////////////////////////////////////////////////////////////////////////////////
// external
@@ -1125,7 +1150,7 @@ void ShowLoginWizard(const std::string& first_screen_name) {
? session_manager::SESSION_STATE_LOGIN_PRIMARY
: session_manager::SESSION_STATE_OOBE);
- LoginDisplayHost* display_host = new LoginDisplayHostImpl(screen_bounds);
+ LoginDisplayHostImpl* display_host = new LoginDisplayHostImpl(screen_bounds);
bool show_app_launch_splash_screen =
(first_screen_name == WizardController::kAppLaunchSplashScreenName);
@@ -1152,9 +1177,11 @@ void ShowLoginWizard(const std::string& first_screen_name) {
if (StartupUtils::IsEulaAccepted()) {
DelayNetworkCall(
+ base::TimeDelta::FromMilliseconds(kDefaultNetworkRetryDelayMS),
ServicesCustomizationDocument::GetInstance()
- ->EnsureCustomizationAppliedClosure(),
- base::TimeDelta::FromMilliseconds(kDefaultNetworkRetryDelayMS));
+ ->EnsureCustomizationAppliedClosure());
+
+ display_host->StartTimeZoneResolve();
}
bool show_login_screen =

Powered by Google App Engine
This is Rietveld 408576698