Commit eaa4b88f authored by Alexander Alekseev's avatar Alexander Alekseev Committed by Commit Bot

Chrome OS: Add fine-grained time zone detection option to settings UI.

This Cl adds support for fine-grained time zone detection to settings UI.

Bug: 721578
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I2788dc9681451dd3abcb95b647866132d67c87c6
Reviewed-on: https://chromium-review.googlesource.com/768471
Commit-Queue: Alexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarMichael Giuffrida <michaelpg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517710}
parent aea3d2d4
...@@ -1218,6 +1218,36 @@ ...@@ -1218,6 +1218,36 @@
<message name="IDS_SETTINGS_DATE_TIME" desc="Name of the settings page which displays date and time preferences."> <message name="IDS_SETTINGS_DATE_TIME" desc="Name of the settings page which displays date and time preferences.">
Date and time Date and time
</message> </message>
<message name="IDS_SETTINGS_TIME_ZONE_BUTTON" desc="Label for the button that opens time zone settings page.">
Time zone
</message>
<message name="IDS_SETTINGS_TIME_ZONE_SUBPAGE_TITLE" desc="The title of the dialog that allows user to control different time zone settings.">
Time zone
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_DISABLED" desc="Display name for the automatic time zone detection mode which disables automatic detection.">
Automatic time zone detection is disabled
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_IP_ONLY_DEFAULT" desc="Display name for the automatic time zone detection mode which enables time zone detection sending unprecise location to Google servers. Default means that this is the default time zone detection mode.">
Set automatically using your general location (default)
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_IP_ONLY_DESCRIPTION" desc="Display name for the automatic time zone detection mode which enables time zone detection by requesting user location from Google servers based on device IP address. Default means that this is the default time zone detection mode.">
Use your IP address to determine location
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_WIFI_AP" desc="Display name for the automatic time zone detection mode which enables time zone detection sending list of visible WiFi Access Point names to Google servers.">
Set automatically using your WiFi network
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_WIFI_AP_DESCRIPTION" desc="Description for the automatic time zone detection mode which enables time zone detection sending list of visible WiFi Access Point names to Google servers.">
Use WiFi network to determine location
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_ALL_INFO" desc="Display name for the automatic time zone detection mode which enables time zone detection sending list of visible WiFi and Cellular Access Point names to Google servers.">
Set automatically using your accurate location
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_ALL_INFO_DESCRIPTION" desc="Description for the automatic time zone detection mode which enables time zone detection sending list of visible WiFi and Cellular Access Point names to Google servers.">
Use WiFi or cellular network to determine location
</message>
<message name="IDS_SETTINGS_TIME_ZONE_DETECTION_SELECT_YOUR_TIME_ZONE" desc="Option name in the list of automatic time zone detection modes that turns automatic detection off, and suggests user to select time zone from the displayed drop-down list.">
Choose from list
</message>
<message name="IDS_SETTINGS_TIME_ZONE" desc="Label for the picker which allows users to choose their time zone."> <message name="IDS_SETTINGS_TIME_ZONE" desc="Label for the picker which allows users to choose their time zone.">
Time zone: Time zone:
</message> </message>
......
...@@ -23,6 +23,8 @@ SystemSettingsProvider::SystemSettingsProvider( ...@@ -23,6 +23,8 @@ SystemSettingsProvider::SystemSettingsProvider(
new base::Value(timezone_settings->GetCurrentTimezoneID())); new base::Value(timezone_settings->GetCurrentTimezoneID()));
per_user_timezone_enabled_value_.reset( per_user_timezone_enabled_value_.reset(
new base::Value(system::PerUserTimezoneEnabled())); new base::Value(system::PerUserTimezoneEnabled()));
fine_grained_time_zone_enabled_value_.reset(
new base::Value(system::FineGrainedTimeZoneDetectionEnabled()));
} }
SystemSettingsProvider::~SystemSettingsProvider() { SystemSettingsProvider::~SystemSettingsProvider() {
...@@ -45,6 +47,7 @@ void SystemSettingsProvider::DoSet(const std::string& path, ...@@ -45,6 +47,7 @@ void SystemSettingsProvider::DoSet(const std::string& path,
system::TimezoneSettings::GetInstance()->SetTimezoneFromID(timezone_id); system::TimezoneSettings::GetInstance()->SetTimezoneFromID(timezone_id);
} }
// kPerUserTimezoneEnabled is read-only. // kPerUserTimezoneEnabled is read-only.
// kFineGrainedTimeZoneResolveEnabled is read-only.
} }
const base::Value* SystemSettingsProvider::Get(const std::string& path) const { const base::Value* SystemSettingsProvider::Get(const std::string& path) const {
...@@ -54,6 +57,9 @@ const base::Value* SystemSettingsProvider::Get(const std::string& path) const { ...@@ -54,6 +57,9 @@ const base::Value* SystemSettingsProvider::Get(const std::string& path) const {
if (path == kPerUserTimezoneEnabled) if (path == kPerUserTimezoneEnabled)
return per_user_timezone_enabled_value_.get(); return per_user_timezone_enabled_value_.get();
if (path == kFineGrainedTimeZoneResolveEnabled)
return fine_grained_time_zone_enabled_value_.get();
return NULL; return NULL;
} }
...@@ -64,7 +70,8 @@ CrosSettingsProvider::TrustedStatus ...@@ -64,7 +70,8 @@ CrosSettingsProvider::TrustedStatus
} }
bool SystemSettingsProvider::HandlesSetting(const std::string& path) const { bool SystemSettingsProvider::HandlesSetting(const std::string& path) const {
return path == kSystemTimezone || path == kPerUserTimezoneEnabled; return path == kSystemTimezone || path == kPerUserTimezoneEnabled ||
path == kFineGrainedTimeZoneResolveEnabled;
} }
void SystemSettingsProvider::TimezoneChanged(const icu::TimeZone& timezone) { void SystemSettingsProvider::TimezoneChanged(const icu::TimeZone& timezone) {
......
...@@ -40,6 +40,7 @@ class SystemSettingsProvider : public CrosSettingsProvider, ...@@ -40,6 +40,7 @@ class SystemSettingsProvider : public CrosSettingsProvider,
std::unique_ptr<base::Value> timezone_value_; std::unique_ptr<base::Value> timezone_value_;
std::unique_ptr<base::Value> per_user_timezone_enabled_value_; std::unique_ptr<base::Value> per_user_timezone_enabled_value_;
std::unique_ptr<base::Value> fine_grained_time_zone_enabled_value_;
DISALLOW_COPY_AND_ASSIGN(SystemSettingsProvider); DISALLOW_COPY_AND_ASSIGN(SystemSettingsProvider);
}; };
......
...@@ -85,26 +85,12 @@ ServiceConfiguration GetServiceConfigurationFromPolicy() { ...@@ -85,26 +85,12 @@ ServiceConfiguration GetServiceConfigurationFromPolicy() {
return result; return result;
} }
// Convert kResolveTimezoneByGeolocationMethod /
// kResolveDeviceTimezoneByGeolocationMethod preference value to
// TimeZoneResolveMethod. Defaults to DISABLED for unknown values.
TimeZoneResolverManager::TimeZoneResolveMethod TimeZoneResolveMethodFromInt(
int value) {
if (value < 0 ||
value >=
static_cast<int>(
TimeZoneResolverManager::TimeZoneResolveMethod::METHODS_NUMBER)) {
return TimeZoneResolverManager::TimeZoneResolveMethod::DISABLED;
}
return static_cast<TimeZoneResolverManager::TimeZoneResolveMethod>(value);
}
// Returns service configuration for the user. // Returns service configuration for the user.
ServiceConfiguration GetServiceConfigurationFromUserPrefs( ServiceConfiguration GetServiceConfigurationFromUserPrefs(
const PrefService* user_prefs) { const PrefService* user_prefs) {
return TimeZoneResolveMethodFromInt(user_prefs->GetInteger( return TimeZoneResolverManager::TimeZoneResolveMethodFromInt(
prefs::kResolveTimezoneByGeolocationMethod)) == user_prefs->GetInteger(
prefs::kResolveTimezoneByGeolocationMethod)) ==
TimeZoneResolverManager::TimeZoneResolveMethod::DISABLED TimeZoneResolverManager::TimeZoneResolveMethod::DISABLED
? SHOULD_STOP ? SHOULD_STOP
: SHOULD_START; : SHOULD_START;
...@@ -128,7 +114,8 @@ ServiceConfiguration GetServiceConfigurationForSigninScreen() { ...@@ -128,7 +114,8 @@ ServiceConfiguration GetServiceConfigurationForSigninScreen() {
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginUser)) if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kLoginUser))
return SHOULD_STOP; return SHOULD_STOP;
return TimeZoneResolveMethodFromInt(device_pref->GetValue()->GetInt()) == return TimeZoneResolverManager::TimeZoneResolveMethodFromInt(
device_pref->GetValue()->GetInt()) ==
TimeZoneResolverManager::TimeZoneResolveMethod::DISABLED TimeZoneResolverManager::TimeZoneResolveMethod::DISABLED
? SHOULD_STOP ? SHOULD_STOP
: SHOULD_START; : SHOULD_START;
...@@ -243,6 +230,26 @@ void TimeZoneResolverManager::OnLocalStateInitialized(bool initialized) { ...@@ -243,6 +230,26 @@ void TimeZoneResolverManager::OnLocalStateInitialized(bool initialized) {
UpdateTimezoneResolver(); UpdateTimezoneResolver();
} }
// static
TimeZoneResolverManager::TimeZoneResolveMethod
TimeZoneResolverManager::TimeZoneResolveMethodFromInt(int value) {
if (value < 0 ||
value >= static_cast<int>(TimeZoneResolveMethod::METHODS_NUMBER)) {
return TimeZoneResolveMethod::DISABLED;
}
const TimeZoneResolveMethod method =
static_cast<TimeZoneResolveMethod>(value);
if (FineGrainedTimeZoneDetectionEnabled())
return method;
if (method == TimeZoneResolveMethod::DISABLED)
return TimeZoneResolveMethod::DISABLED;
return TimeZoneResolveMethod::IP_ONLY;
}
// static // static
TimeZoneResolverManager::TimeZoneResolveMethod TimeZoneResolverManager::TimeZoneResolveMethod
TimeZoneResolverManager::GetEffectiveUserTimeZoneResolveMethod( TimeZoneResolverManager::GetEffectiveUserTimeZoneResolveMethod(
......
...@@ -50,6 +50,11 @@ class TimeZoneResolverManager : public TimeZoneResolver::Delegate { ...@@ -50,6 +50,11 @@ class TimeZoneResolverManager : public TimeZoneResolver::Delegate {
// all configuration data. // all configuration data.
bool TimeZoneResolverShouldBeRunning(); bool TimeZoneResolverShouldBeRunning();
// Convert kResolveTimezoneByGeolocationMethod /
// kResolveDeviceTimezoneByGeolocationMethod preference value to
// TimeZoneResolveMethod. Defaults to DISABLED for unknown values.
static TimeZoneResolveMethod TimeZoneResolveMethodFromInt(int value);
// Returns user preference value if time zone is not managed. // Returns user preference value if time zone is not managed.
// Otherwise returns effective time zone resolve method. // Otherwise returns effective time zone resolve method.
// If |check_policy| is true, effective method calculation will also // If |check_policy| is true, effective method calculation will also
......
...@@ -188,7 +188,8 @@ bool HasSystemTimezonePolicy() { ...@@ -188,7 +188,8 @@ bool HasSystemTimezonePolicy() {
} }
bool IsTimezonePrefsManaged(const std::string& pref_name) { bool IsTimezonePrefsManaged(const std::string& pref_name) {
DCHECK(pref_name == prefs::kUserTimezone || DCHECK(pref_name == chromeos::kSystemTimezone ||
pref_name == prefs::kUserTimezone ||
pref_name == prefs::kResolveTimezoneByGeolocationMethod); pref_name == prefs::kResolveTimezoneByGeolocationMethod);
std::string policy_timezone; std::string policy_timezone;
...@@ -197,6 +198,14 @@ bool IsTimezonePrefsManaged(const std::string& pref_name) { ...@@ -197,6 +198,14 @@ bool IsTimezonePrefsManaged(const std::string& pref_name) {
return true; return true;
} }
// System time zone preference is managed only if kSystemTimezonePolicy
// present, which we checked above.
//
// kSystemTimezoneAutomaticDetectionPolicy (see below) controls only user
// time zone preference, and user time zone resolve preference.
if (pref_name == chromeos::kSystemTimezone)
return false;
const PrefService* local_state = g_browser_process->local_state(); const PrefService* local_state = g_browser_process->local_state();
if (!local_state->IsManagedPreference( if (!local_state->IsManagedPreference(
prefs::kSystemTimezoneAutomaticDetectionPolicy)) { prefs::kSystemTimezoneAutomaticDetectionPolicy)) {
...@@ -337,5 +346,10 @@ void SetTimezoneFromUI(Profile* profile, const std::string& timezone_id) { ...@@ -337,5 +346,10 @@ void SetTimezoneFromUI(Profile* profile, const std::string& timezone_id) {
NOTREACHED(); NOTREACHED();
} }
bool FineGrainedTimeZoneDetectionEnabled() {
return !base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableFineGrainedTimeZoneDetection);
}
} // namespace system } // namespace system
} // namespace chromeos } // namespace chromeos
...@@ -56,6 +56,9 @@ bool PerUserTimezoneEnabled(); ...@@ -56,6 +56,9 @@ bool PerUserTimezoneEnabled();
// This is called from UI code to apply user-selected time zone. // This is called from UI code to apply user-selected time zone.
void SetTimezoneFromUI(Profile* profile, const std::string& timezone_id); void SetTimezoneFromUI(Profile* profile, const std::string& timezone_id);
// Returns true if fine-grained time zone detection is enabled.
bool FineGrainedTimeZoneDetectionEnabled();
} // namespace system } // namespace system
} // namespace chromeos } // namespace chromeos
......
...@@ -332,10 +332,14 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() { ...@@ -332,10 +332,14 @@ const PrefsUtil::TypedPrefMap& PrefsUtil::GetWhitelistedKeys() {
settings_private::PrefType::PREF_TYPE_STRING; settings_private::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[prefs::kUserTimezone] = (*s_whitelist)[prefs::kUserTimezone] =
settings_private::PrefType::PREF_TYPE_STRING; settings_private::PrefType::PREF_TYPE_STRING;
(*s_whitelist)[::prefs::kResolveTimezoneByGeolocationMethod] = (*s_whitelist)[prefs::kResolveTimezoneByGeolocationMethod] =
settings_private::PrefType::PREF_TYPE_NUMBER; settings_private::PrefType::PREF_TYPE_NUMBER;
(*s_whitelist)[chromeos::kPerUserTimezoneEnabled] = (*s_whitelist)[chromeos::kPerUserTimezoneEnabled] =
settings_private::PrefType::PREF_TYPE_BOOLEAN; settings_private::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[chromeos::kFineGrainedTimeZoneResolveEnabled] =
settings_private::PrefType::PREF_TYPE_BOOLEAN;
(*s_whitelist)[prefs::kSystemTimezoneAutomaticDetectionPolicy] =
settings_private::PrefType::PREF_TYPE_NUMBER;
// Ash settings. // Ash settings.
(*s_whitelist)[ash::prefs::kEnableStylusTools] = (*s_whitelist)[ash::prefs::kEnableStylusTools] =
...@@ -639,7 +643,19 @@ PrefsUtil::SetPrefResult PrefsUtil::SetPref(const std::string& pref_name, ...@@ -639,7 +643,19 @@ PrefsUtil::SetPrefResult PrefsUtil::SetPref(const std::string& pref_name,
if (!value->GetAsDouble(&double_value)) if (!value->GetAsDouble(&double_value))
return PREF_TYPE_MISMATCH; return PREF_TYPE_MISMATCH;
pref_service->SetInteger(pref_name, static_cast<int>(double_value)); bool value_set = false;
#if defined(OS_CHROMEOS)
if (pref_name == ::prefs::kResolveTimezoneByGeolocationMethod) {
pref_service->SetInteger(
pref_name,
static_cast<int>(chromeos::system::TimeZoneResolverManager::
TimeZoneResolveMethodFromInt(
static_cast<int>(double_value))));
value_set = true;
}
#endif
if (!value_set)
pref_service->SetInteger(pref_name, static_cast<int>(double_value));
break; break;
} }
case base::Value::Type::STRING: { case base::Value::Type::STRING: {
...@@ -739,9 +755,9 @@ bool PrefsUtil::IsPrefEnterpriseManaged(const std::string& pref_name) { ...@@ -739,9 +755,9 @@ bool PrefsUtil::IsPrefEnterpriseManaged(const std::string& pref_name) {
return false; return false;
if (IsPrivilegedCrosSetting(pref_name)) if (IsPrivilegedCrosSetting(pref_name))
return true; return true;
if (chromeos::system::PerUserTimezoneEnabled() && if (pref_name == chromeos::kSystemTimezone ||
(pref_name == prefs::kUserTimezone || pref_name == prefs::kUserTimezone ||
pref_name == prefs::kResolveTimezoneByGeolocationMethod)) { pref_name == prefs::kResolveTimezoneByGeolocationMethod) {
return chromeos::system::IsTimezonePrefsManaged(pref_name); return chromeos::system::IsTimezonePrefsManaged(pref_name);
} }
return false; return false;
......
...@@ -6,13 +6,46 @@ ...@@ -6,13 +6,46 @@
{ {
'target_name': 'date_time_page', 'target_name': 'date_time_page',
'dependencies': [ 'dependencies': [
'../controls/compiled_resources2.gyp:settings_dropdown_menu', '../compiled_resources2.gyp:route',
'../prefs/compiled_resources2.gyp:prefs_behavior', '../prefs/compiled_resources2.gyp:prefs_behavior',
'../prefs/compiled_resources2.gyp:prefs_types', '../prefs/compiled_resources2.gyp:prefs_types',
'<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_indicator_behavior', '<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_indicator_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:load_time_data',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:web_ui_listener_behavior', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:web_ui_listener_behavior',
'date_time_types',
'timezone_selector',
'timezone_subpage',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'date_time_types',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'timezone_selector',
'dependencies': [
'../controls/compiled_resources2.gyp:settings_dropdown_menu',
'../prefs/compiled_resources2.gyp:prefs_behavior',
'../prefs/compiled_resources2.gyp:prefs_types',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
'date_time_types',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'timezone_subpage',
'dependencies': [
'../prefs/compiled_resources2.gyp:prefs_behavior',
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'date_time_types',
'timezone_selector',
], ],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'], 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
}, },
......
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
<link rel="import" href="chrome://resources/html/cr.html"> <link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html"> <link rel="import" href="chrome://resources/html/web_ui_listener_behavior.html">
<link rel="import" href="chrome://resources/cr_elements/policy/cr_policy_indicator.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-icon-button/paper-icon-button-light.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-toggle-button/paper-toggle-button.html">
<link rel="import" href="../controls/settings_dropdown_menu.html">
<link rel="import" href="../controls/settings_toggle_button.html"> <link rel="import" href="../controls/settings_toggle_button.html">
<link rel="import" href="../i18n_setup.html"> <link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs_behavior.html"> <link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../prefs/prefs_types.html"> <link rel="import" href="../prefs/prefs_types.html">
<link rel="import" href="../route.html">
<link rel="import" href="../settings_page/settings_subpage.html">
<link rel="import" href="../settings_shared_css.html"> <link rel="import" href="../settings_shared_css.html">
<link rel="import" href="date_time_types.html">
<link rel="import" href="timezone_selector.html">
<link rel="import" href="timezone_subpage.html">
<dom-module id="settings-date-time-page"> <dom-module id="settings-date-time-page">
<template> <template>
...@@ -19,8 +24,11 @@ ...@@ -19,8 +24,11 @@
padding: 0; padding: 0;
} }
settings-dropdown-menu { #timeZoneButton {
--md-select-width: 400px; display: flex;
flex-direction: column;
justify-content: center;
width: 100%;
} }
paper-toggle-button { paper-toggle-button {
...@@ -31,67 +39,90 @@ ...@@ -31,67 +39,90 @@
-webkit-margin-start: var(--settings-controlled-by-spacing); -webkit-margin-start: var(--settings-controlled-by-spacing);
} }
</style> </style>
<div class="settings-box first"> <settings-animated-pages id="pages" section="dateTime"
<div id="timezoneGeolocateToggleLabel" class="start"> focus-config="[[focusConfig_]]">
$i18n{timeZoneGeolocation} <neon-animatable id="main" route-path="default">
</div> <template is="dom-if"
<template is="dom-if" if="[[hasTimeZoneAutoDetectPolicy_]]" restamp> if="[[!prefs.cros.flags.fine_grained_time_zone_detection_enabled.value]]"
<cr-policy-indicator indicator-type="devicePolicy"
icon-aria-label="$i18n{timeZoneGeolocation}">
</cr-policy-indicator>
</template>
<paper-toggle-button
id="timeZoneAutoDetect"
aria-label="$i18n{timeZoneGeolocation}"
checked="[[timeZoneAutoDetect_]]"
disabled="[[hasTimeZoneAutoDetectPolicy_]]"
on-change="onTimeZoneAutoDetectChange_">
</paper-toggle-button>
</div>
<div class="settings-box continuation embedded">
<template is="dom-if" restamp
if="[[!prefs.cros.flags.per_user_timezone_enabled.value]]">
<settings-dropdown-menu pref="{{prefs.cros.system.timezone}}"
label="$i18n{timeZone}"
menu-options="[[timeZoneList_]]"
disabled="[[timeZoneAutoDetect_]]">
</settings-dropdown-menu>
</template>
<template is="dom-if" restamp
if="[[prefs.cros.flags.per_user_timezone_enabled.value]]">
<template is="dom-if" if="[[!isUserTimeZoneSelectorHidden_(
prefs.settings.timezone,
prefs.settings.resolve_timezone_by_geolocation_method.value)]]"
restamp> restamp>
<settings-dropdown-menu id="userTimeZoneSelector" <div class="settings-box first">
pref="{{prefs.settings.timezone}}" <div id="timezoneGeolocateToggleLabel" class="start">
label="$i18n{timeZone}" $i18n{timeZoneGeolocation}
menu-options="[[timeZoneList_]]"> </div>
</settings-dropdown-menu> <template is="dom-if"
if="[[hasTimeZoneAutoDetectPolicyRestriction_]]" restamp>
<cr-policy-indicator indicator-type="devicePolicy"
icon-aria-label="$i18n{timeZoneGeolocation}">
</cr-policy-indicator>
</template>
<paper-toggle-button
id="timeZoneAutoDetect"
aria-label="$i18n{timeZoneGeolocation}"
checked="[[timeZoneAutoDetect_]]"
disabled="[[hasTimeZoneAutoDetectPolicyRestriction_]]"
on-change="onTimeZoneAutoDetectChange_">
</paper-toggle-button>
</div>
</template> </template>
<template is="dom-if" if="[[isUserTimeZoneSelectorHidden_( <template is="dom-if"
prefs.settings.timezone, if="[[prefs.cros.flags.fine_grained_time_zone_detection_enabled.value]]"
prefs.settings.resolve_timezone_by_geolocation_method.value)]]"
restamp> restamp>
<settings-dropdown-menu id="systemTimezoneSelector" <div id="timeZoneSettingsTrigger" class="settings-box first"
pref="{{prefs.cros.system.timezone}}" on-tap="onTimeZoneSettings_" actionable>
label="$i18n{timeZone}" <div id="timeZoneButton" class="two-line">
menu-options="[[timeZoneList_]]" $i18n{timeZoneButton}
disabled> <div class="secondary">
</settings-dropdown-menu> <div hidden="[[timeZoneAutoDetect_]]">
[[activeTimeZoneDisplayName]]
</div>
<div hidden="[[!timeZoneAutoDetect_]]">
[[getTimeZoneAutoDetectMethodDisplayName_(
timeZoneAutoDetectMethod_)]]
</div>
</div>
</div>
<template is="dom-if"
if="[[hasTimeZoneAutoDetectPolicyRestriction_]]" restamp>
<cr-policy-indicator indicator-type="devicePolicy"
icon-aria-label="$i18n{timeZoneGeolocation}"
hidden="[[!hasTimeZoneAutoDetectPolicyRestriction_]]">
</cr-policy-indicator>
</template>
<button class="subpage-arrow"
disabled="[[hasTimeZoneAutoDetectPolicyRestriction_]]"
is="paper-icon-button-light"
aria-label="$i18n{timeZoneButton}"></button>
</div>
</template> </template>
<div class="settings-box continuation embedded"
hidden="[[prefs.cros.flags.fine_grained_time_zone_detection_enabled.value]]">
<timezone-selector prefs="{{prefs}}"
time-zone-auto-detect="[[timeZoneAutoDetect_]]"
active-time-zone-display-name="{{activeTimeZoneDisplayName}}">
</timezone-selector>
</div>
<settings-toggle-button
pref="{{prefs.settings.clock.use_24hour_clock}}"
label="$i18n{use24HourClock}">
</settings-toggle-button>
<div class="settings-box" id="setDateTime" actionable
on-tap="onSetDateTimeTap_" hidden$="[[!canSetDateTime_]]">
<div class="start">$i18n{setDateTime}</div>
<button class="subpage-arrow" is="paper-icon-button-light"
aria-label="$i18n{setDateTime}"></button>
</div>
</neon-animatable>
<template is="dom-if" route-path="/dateTime/timeZone">
<settings-subpage data-route="DATETIME_TIMEZONE_SUBPAGE"
associated-control="[[$$('#timeZoneSettingsTrigger')]]"
page-title="$i18n{timeZoneSubpageTitle}">
<timezone-subpage id="timezoneSubpage" prefs="{{prefs}}"
time-zone-auto-detect="[[timeZoneAutoDetect_]]"
active-time-zone-display-name="{{activeTimeZoneDisplayName}}">
</timezone-subpage>
</settings-subpage>
</template> </template>
</div> </settings-animated-pages>
<settings-toggle-button
pref="{{prefs.settings.clock.use_24hour_clock}}"
label="$i18n{use24HourClock}">
</settings-toggle-button>
<div class="settings-box" id="setDateTime" actionable
on-tap="onSetDateTimeTap_" hidden$="[[!canSetDateTime_]]">
<div class="start">$i18n{setDateTime}</div>
<button class="subpage-arrow" is="paper-icon-button-light"
aria-label="$i18n{setDateTime}"></button>
</div>
</template> </template>
<script src="date_time_page.js"></script> <script src="date_time_page.js"></script>
</dom-module> </dom-module>
<link rel="import" href="chrome://resources/html/cr.html">
<script src="date_time_types.js"></script>
// Copyright 2017 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.
/**
* @fileoverview
* This defines some types for settings-date-time-page.
*/
cr.exportPath('settings');
/**
* Describes the effective policy restriction on time zone automatic detection.
* @enum {number}
*/
settings.TimeZoneAutoDetectPolicyRestriction = {
NONE: 0,
FORCED_ON: 1,
FORCED_OFF: 2,
};
/**
* Describes values of prefs.settings.resolve_timezone_by_geolocation_method.
* Must be kept in sync with TimeZoneResolverManager::TimeZoneResolveMethod
* enum.
* @enum {number}
*/
settings.TimeZoneAutoDetectMethod = {
DISABLED: 0,
IP_ONLY: 1,
SEND_WIFI_ACCESS_POINTS: 2,
SEND_ALL_LOCATION_INFO: 3
};
/**
* Describes values of prefs.settings.
* resolve_device_timezone_by_geolocation_policy
* Must be kept in sync with enterprise_management::SystemTimezoneProto
* enum.
* @enum {number}
*/
settings.SystemTimezoneProto = {
USERS_DECIDE: 0,
DISABLED: 1,
IP_ONLY: 2,
SEND_WIFI_ACCESS_POINTS: 3,
SEND_ALL_LOCATION_INFO: 4,
};
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="../controls/settings_dropdown_menu.html">
<link rel="import" href="../i18n_setup.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../prefs/prefs_types.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="date_time_types.html">
<dom-module id="timezone-selector">
<template>
<style include="settings-shared">
settings-dropdown-menu {
--md-select-width: 400px;
}
</style>
<template is="dom-if" restamp
if="[[!prefs.cros.flags.per_user_timezone_enabled.value]]">
<settings-dropdown-menu pref="{{prefs.cros.system.timezone}}"
label="$i18n{timeZoneColon}"
menu-options="[[timeZoneList_]]"
disabled="[[timeZoneAutoDetect]]">
</settings-dropdown-menu>
</template>
<template is="dom-if" restamp
if="[[prefs.cros.flags.per_user_timezone_enabled.value]]">
<template is="dom-if" if="[[!isUserTimeZoneSelectorHidden_(
prefs.settings.timezone,
prefs.settings.resolve_timezone_by_geolocation_method.value)]]"
restamp>
<settings-dropdown-menu id="userTimeZoneSelector"
pref="{{prefs.settings.timezone}}"
label="$i18n{timeZoneColon}"
menu-options="[[timeZoneList_]]">
</settings-dropdown-menu>
</template>
<template is="dom-if" if="[[isUserTimeZoneSelectorHidden_(
prefs.settings.timezone,
prefs.settings.resolve_timezone_by_geolocation_method.value)]]"
restamp>
<settings-dropdown-menu id="systemTimezoneSelector"
pref="{{prefs.cros.system.timezone}}"
label="$i18n{timeZoneColon}"
menu-options="[[timeZoneList_]]"
disabled>
</settings-dropdown-menu>
</template>
</template>
</template>
<script src="timezone_selector.js"></script>
</dom-module>
// Copyright 2017 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.
/**
* @fileoverview 'timezone-selector' is the time zone selector dropdown.
*/
(function() {
'use strict';
Polymer({
is: 'timezone-selector',
behaviors: [I18nBehavior, PrefsBehavior],
properties: {
/**
* If time zone auto detectoin is enabled.
*/
timeZoneAutoDetect: Boolean,
/**
* This stores active time zone display name to be used in other UI
* via bi-directional binding.
*/
activeTimeZoneDisplayName: {
type: String,
notify: true,
},
/**
* Initialized with the current time zone so the menu displays the
* correct value. The full option list is fetched lazily if necessary by
* maybeGetTimeZoneList_.
* @private {!DropdownMenuOptionList}
*/
timeZoneList_: {
type: Array,
value: function() {
return [{
name: loadTimeData.getString('timeZoneName'),
value: loadTimeData.getString('timeZoneID'),
}];
},
},
},
observers: [
'maybeGetTimeZoneListPerUser_(' +
'prefs.settings.timezone.value, timeZoneAutoDetect)',
'maybeGetTimeZoneListPerSystem_(' +
'prefs.cros.system.timezone.value, timeZoneAutoDetect)',
'updateActiveTimeZoneName_(prefs.cros.system.timezone.value)',
],
/** @override */
attached: function() {
this.maybeGetTimeZoneList_();
},
/**
* Fetches the list of time zones if necessary.
* @param {boolean=} perUserTimeZoneMode Expected value of per-user time zone.
* @private
*/
maybeGetTimeZoneList_: function(perUserTimeZoneMode) {
if (typeof(perUserTimeZoneMode) !== 'undefined') {
/* This method is called as observer. Skip if if current mode does not
* match expected.
*/
if (perUserTimeZoneMode !=
this.getPref('cros.flags.per_user_timezone_enabled').value) {
return;
}
}
// Only fetch the list once.
if (this.timeZoneList_.length > 1 || !CrSettingsPrefs.isInitialized)
return;
// If auto-detect is enabled, we only need the current time zone.
if (this.timeZoneAutoDetect) {
var isPerUserTimezone =
this.getPref('cros.flags.per_user_timezone_enabled').value;
if (this.timeZoneList_[0].value ==
(isPerUserTimezone ? this.getPref('settings.timezone').value :
this.getPref('cros.system.timezone').value)) {
return;
}
}
cr.sendWithPromise('getTimeZones').then(this.setTimeZoneList_.bind(this));
},
/**
* Prefs observer for Per-user time zone enabled mode.
* @private
*/
maybeGetTimeZoneListPerUser_: function() {
this.maybeGetTimeZoneList_(true);
},
/**
* Prefs observer for Per-user time zone disabled mode.
* @private
*/
maybeGetTimeZoneListPerSystem_: function() {
this.maybeGetTimeZoneList_(false);
},
/**
* Converts the C++ response into an array of menu options.
* @param {!Array<!Array<string>>} timeZones C++ time zones response.
* @private
*/
setTimeZoneList_: function(timeZones) {
this.timeZoneList_ = timeZones.map(function(timeZonePair) {
return {
name: timeZonePair[1],
value: timeZonePair[0],
};
});
this.updateActiveTimeZoneName_(
/** @type {!String} */ (this.getPref('cros.system.timezone').value));
},
/**
* Updates active time zone display name when changed.
* @param {!String} activeTimeZoneId value of cros.system.timezone preference.
* @private
*/
updateActiveTimeZoneName_: function(activeTimeZoneId) {
var activeTimeZone = this.timeZoneList_.find(
(timeZone) => timeZone.value == activeTimeZoneId);
if (activeTimeZone)
this.activeTimeZoneDisplayName = activeTimeZone.name;
},
/**
* Computes visibility of user timezone preference.
* @param {?chrome.settingsPrivate.PrefObject} prefUserTimezone
* pref.settings.timezone
* @param {settings.TimeZoneAutoDetectMethod} prefResolveValue
* prefs.settings.resolve_timezone_by_geolocation_method.value
* @return {boolean}
* @private
*/
isUserTimeZoneSelectorHidden_: function(prefUserTimezone, prefResolveValue) {
return (prefUserTimezone && prefUserTimezone.controlledBy != null) ||
prefResolveValue != settings.TimeZoneAutoDetectMethod.DISABLED;
},
});
})();
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="../controls/controlled_radio_button.html">
<link rel="import" href="../controls/settings_radio_group.html">
<link rel="import" href="../prefs/prefs.html">
<link rel="import" href="../prefs/prefs_behavior.html">
<link rel="import" href="../settings_shared_css.html">
<link rel="import" href="date_time_types.html">
<dom-module id="timezone-subpage">
<template>
<style include="settings-shared">
.block {
display: block;
}
</style>
<div class="settings-box block first">
<settings-radio-group id="timeZoneRadioGroup"
pref="{{prefs.settings.resolve_timezone_by_geolocation_method}}">
<controlled-radio-button
name="[[timezoneAutodetectMethodValues_.IP_ONLY]]"
pref="[[prefs.settings.resolve_timezone_by_geolocation_method]]"
label="$i18n{setTimeZoneAutomaticallyIpOnlyDefault}"
no-extension-indicator>
<div class="secondary">
$i18n{setTimeZoneAutomaticallyIpOnlyDefaultDescription}
</div>
</controlled-radio-button>
<controlled-radio-button
name="[[timezoneAutodetectMethodValues_.SEND_ALL_LOCATION_INFO]]"
pref="[[prefs.settings.resolve_timezone_by_geolocation_method]]"
label="$i18n{setTimeZoneAutomaticallyWithAllLocationInfo}"
no-extension-indicator>
<div class="secondary">
$i18n{setTimeZoneAutomaticallyWithAllLocationInfoDescription}
</div>
</controlled-radio-button>
<controlled-radio-button
name="[[timezoneAutodetectMethodValues_.DISABLED]]"
pref="[[prefs.settings.resolve_timezone_by_geolocation_method]]"
label="$i18n{selectYourTimeZone}"
no-extension-indicator>
</controlled-radio-button>
</settings-radio-group>
</div>
<div class="settings-box block">
<timezone-selector prefs="{{prefs}}"
time-zone-auto-detect="[[timeZoneAutoDetect]]"
active-time-zone-display-name="{{activeTimeZoneDisplayName}}">
</timezone-selector>
</div>
</template>
<script src="timezone_subpage.js"></script>
</dom-module>
// Copyright 2017 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.
/**
* @fileoverview 'timezone-subpage' is the collapsible section containing
* time zone settings.
*/
(function() {
'use strict';
Polymer({
is: 'timezone-subpage',
behaviors: [PrefsBehavior],
properties: {
/**
* This is <timezone-selector> parameter.
*/
activeTimeZoneDisplayName: {
type: String,
notify: true,
},
/**
* The effective time zone auto-detect enabled/disabled status.
*/
timeZoneAutoDetect: Boolean,
/**
* settings.TimeZoneAutoDetectMethod values.
* @private {!Object<settings.TimeZoneAutoDetectMethod, number>}
*/
timezoneAutodetectMethodValues_: Object,
},
attached: function() {
this.timezoneAutodetectMethodValues_ = settings.TimeZoneAutoDetectMethod;
},
});
})();
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
* CLOUD_PRINTERS: (undefined|!settings.Route), * CLOUD_PRINTERS: (undefined|!settings.Route),
* CUPS_PRINTERS: (undefined|!settings.Route), * CUPS_PRINTERS: (undefined|!settings.Route),
* DATETIME: (undefined|!settings.Route), * DATETIME: (undefined|!settings.Route),
* DATETIME_TIMEZONE_SUBPAGE: (undefined|!settings.Route),
* DEFAULT_BROWSER: (undefined|!settings.Route), * DEFAULT_BROWSER: (undefined|!settings.Route),
* DETAILED_BUILD_INFO: (undefined|!settings.Route), * DETAILED_BUILD_INFO: (undefined|!settings.Route),
* DEVICE: (undefined|!settings.Route), * DEVICE: (undefined|!settings.Route),
...@@ -333,6 +334,8 @@ cr.define('settings', function() { ...@@ -333,6 +334,8 @@ cr.define('settings', function() {
// <if expr="chromeos"> // <if expr="chromeos">
if (pageVisibility.dateTime !== false) { if (pageVisibility.dateTime !== false) {
r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime'); r.DATETIME = r.ADVANCED.createSection('/dateTime', 'dateTime');
r.DATETIME_TIMEZONE_SUBPAGE =
r.DATETIME.createChild('/dateTime/timeZone');
} }
// </if> // </if>
......
...@@ -1108,6 +1108,24 @@ ...@@ -1108,6 +1108,24 @@
<structure name="IDR_SETTINGS_DATE_TIME_PAGE_JS" <structure name="IDR_SETTINGS_DATE_TIME_PAGE_JS"
file="date_time_page/date_time_page.js" file="date_time_page/date_time_page.js"
type="chrome_html" /> type="chrome_html" />
<structure name="IDR_SETTINGS_DATE_TIME_TYPES_HTML"
file="date_time_page/date_time_types.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_DATE_TIME_TYPES_JS"
file="date_time_page/date_time_types.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_TIMEZONE_SELECTOR_HTML"
file="date_time_page/timezone_selector.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_TIMEZONE_SELECTOR_JS"
file="date_time_page/timezone_selector.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_TIMEZONE_SUBPAGE_HTML"
file="date_time_page/timezone_subpage.html"
type="chrome_html" />
<structure name="IDR_SETTINGS_TIMEZONE_SUBPAGE_JS"
file="date_time_page/timezone_subpage.js"
type="chrome_html" />
<structure name="IDR_SETTINGS_INTERNET_CONFIG_HTML" <structure name="IDR_SETTINGS_INTERNET_CONFIG_HTML"
file="internet_page/internet_config.html" file="internet_page/internet_config.html"
type="chrome_html" /> type="chrome_html" />
......
...@@ -835,8 +835,26 @@ void AddImportDataStrings(content::WebUIDataSource* html_source) { ...@@ -835,8 +835,26 @@ void AddImportDataStrings(content::WebUIDataSource* html_source) {
void AddDateTimeStrings(content::WebUIDataSource* html_source) { void AddDateTimeStrings(content::WebUIDataSource* html_source) {
LocalizedString localized_strings[] = { LocalizedString localized_strings[] = {
{"dateTimePageTitle", IDS_SETTINGS_DATE_TIME}, {"dateTimePageTitle", IDS_SETTINGS_DATE_TIME},
{"timeZone", IDS_SETTINGS_TIME_ZONE}, {"timeZoneColon", IDS_SETTINGS_TIME_ZONE},
{"timeZoneGeolocation", IDS_SETTINGS_TIME_ZONE_GEOLOCATION}, {"timeZoneGeolocation", IDS_SETTINGS_TIME_ZONE_GEOLOCATION},
{"timeZoneButton", IDS_SETTINGS_TIME_ZONE_BUTTON},
{"timeZoneSubpageTitle", IDS_SETTINGS_TIME_ZONE_SUBPAGE_TITLE},
{"setTimeZoneAutomaticallyDisabled",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_DISABLED},
{"setTimeZoneAutomaticallyIpOnlyDefault",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_IP_ONLY_DEFAULT},
{"setTimeZoneAutomaticallyIpOnlyDefaultDescription",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_IP_ONLY_DESCRIPTION},
{"setTimeZoneAutomaticallyWithWiFiAccessPointsData",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_WIFI_AP},
{"setTimeZoneAutomaticallyWithWiFiAccessPointsDataDescription",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_WIFI_AP_DESCRIPTION},
{"setTimeZoneAutomaticallyWithAllLocationInfo",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_ALL_INFO},
{"setTimeZoneAutomaticallyWithAllLocationInfoDescription",
IDS_SETTINGS_TIME_ZONE_DETECTION_MODE_SEND_ALL_INFO_DESCRIPTION},
{"selectYourTimeZone",
IDS_SETTINGS_TIME_ZONE_DETECTION_SELECT_YOUR_TIME_ZONE},
{"use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK}, {"use24HourClock", IDS_SETTINGS_USE_24_HOUR_CLOCK},
{"setDateTime", IDS_SETTINGS_SET_DATE_TIME}, {"setDateTime", IDS_SETTINGS_SET_DATE_TIME},
}; };
......
...@@ -528,6 +528,10 @@ const char kEnterpriseDisableLicenseTypeSelection[] = ...@@ -528,6 +528,10 @@ const char kEnterpriseDisableLicenseTypeSelection[] =
// Disables per-user timezone. // Disables per-user timezone.
const char kDisablePerUserTimezone[] = "disable-per-user-timezone"; const char kDisablePerUserTimezone[] = "disable-per-user-timezone";
// Disables fine grained time zone detection.
const char kDisableFineGrainedTimeZoneDetection[] =
"disable-fine-grained-time-zone-detection";
bool WakeOnWifiEnabled() { bool WakeOnWifiEnabled() {
return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi); return !base::CommandLine::ForCurrentProcess()->HasSwitch(kDisableWakeOnWifi);
} }
......
...@@ -98,6 +98,7 @@ CHROMEOS_EXPORT extern const char kEnableTouchCalibrationSetting[]; ...@@ -98,6 +98,7 @@ CHROMEOS_EXPORT extern const char kEnableTouchCalibrationSetting[];
CHROMEOS_EXPORT extern const char kEnableTouchpadThreeFingerClick[]; CHROMEOS_EXPORT extern const char kEnableTouchpadThreeFingerClick[];
CHROMEOS_EXPORT extern const char kEnableFileManagerTouchMode[]; CHROMEOS_EXPORT extern const char kEnableFileManagerTouchMode[];
CHROMEOS_EXPORT extern const char kDisableFileManagerTouchMode[]; CHROMEOS_EXPORT extern const char kDisableFileManagerTouchMode[];
CHROMEOS_EXPORT extern const char kDisableFineGrainedTimeZoneDetection[];
CHROMEOS_EXPORT extern const char kEnableVideoPlayerChromecastSupport[]; CHROMEOS_EXPORT extern const char kEnableVideoPlayerChromecastSupport[];
CHROMEOS_EXPORT extern const char kEnableVoiceInteraction[]; CHROMEOS_EXPORT extern const char kEnableVoiceInteraction[];
CHROMEOS_EXPORT extern const char kEnableZipArchiverPacker[]; CHROMEOS_EXPORT extern const char kEnableZipArchiverPacker[];
......
...@@ -248,6 +248,11 @@ const char kDeviceLoginScreenInputMethods[] = ...@@ -248,6 +248,11 @@ const char kDeviceLoginScreenInputMethods[] =
// A boolean pref that matches enable-per-user-time-zone chrome://flags value. // A boolean pref that matches enable-per-user-time-zone chrome://flags value.
const char kPerUserTimezoneEnabled[] = "cros.flags.per_user_timezone_enabled"; const char kPerUserTimezoneEnabled[] = "cros.flags.per_user_timezone_enabled";
// A boolean pref that matches enable-fine-graned-time-zone-detection
// chrome://flags value.
const char kFineGrainedTimeZoneResolveEnabled[] =
"cros.flags.fine_grained_time_zone_detection_enabled";
// A dictionary pref containing time intervals and ignored policies. // A dictionary pref containing time intervals and ignored policies.
// It's used to allow less restricted usage of Chrome OS during off-hours. // It's used to allow less restricted usage of Chrome OS during off-hours.
// This pref is set by an admin policy. // This pref is set by an admin policy.
......
...@@ -120,6 +120,7 @@ CHROMEOS_EXPORT extern const char kDeviceLoginScreenLocales[]; ...@@ -120,6 +120,7 @@ CHROMEOS_EXPORT extern const char kDeviceLoginScreenLocales[];
CHROMEOS_EXPORT extern const char kDeviceLoginScreenInputMethods[]; CHROMEOS_EXPORT extern const char kDeviceLoginScreenInputMethods[];
CHROMEOS_EXPORT extern const char kPerUserTimezoneEnabled[]; CHROMEOS_EXPORT extern const char kPerUserTimezoneEnabled[];
CHROMEOS_EXPORT extern const char kFineGrainedTimeZoneResolveEnabled[];
CHROMEOS_EXPORT extern const char kDeviceOffHours[]; CHROMEOS_EXPORT extern const char kDeviceOffHours[];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment