$('advanced-settings').addEventListener('webkitTransitionEnd',
this.updateAdvancedSettingsExpander_.bind(this));
- if (cr.isChromeOS)
+ if (cr.isChromeOS) {
UIAccountTweaks.applyGuestModeVisibility(document);
+ if (loadTimeData.getBoolean('secondaryUser'))
+ $('secondary-user-banner').hidden = false;
+ }
// Sync (Sign in) section.
this.updateSyncState_(loadTimeData.getValue('syncData'));
// Internet connection section (ChromeOS only).
if (cr.isChromeOS) {
options.network.NetworkList.decorate($('network-list'));
+ // Show that the network settings are shared if this is a secondary user
+ // in a multi-profile session.
+ if (loadTimeData.getBoolean('secondaryUser')) {
+ var networkIndicator = document.querySelector(
+ '#network-section-header > .controlled-setting-indicator');
+ networkIndicator.setAttribute('controlled-by', 'shared');
+ networkIndicator.location = cr.ui.ArrowLocation.TOP_START;
+ }
options.network.NetworkList.refreshNetworkData(
loadTimeData.getValue('networkData'));
}
OptionsPage.navigateToPage('homePageOverlay');
};
- Preferences.getInstance().addEventListener('hotword.search_enabled',
- this.onHotwordSearchPrefChanged_.bind(this));
- chrome.send('requestHotwordAvailabile');
+ chrome.send('requestHotwordAvailable');
if ($('set-wallpaper')) {
$('set-wallpaper').onclick = function(event) {
// Users section.
if (loadTimeData.valueExists('profilesInfo')) {
$('profiles-section').hidden = false;
+ $('sync-users-section').hidden =
+ $('profiles-section').hidden &&
+ $('sync-section').hidden &&
+ $('profiles-supervised-dashboard-tip').hidden;
var profilesList = $('profiles-list');
options.browser_options.ProfileList.decorate(profilesList);
chrome.send('coreOptionsUserMetricsAction',
['Options_ManageAccounts']);
};
+
+ document.querySelector(
+ '#enable-screen-lock + span > .controlled-setting-indicator').
+ setAttribute('textshared',
+ loadTimeData.getString('screenLockShared'));
} else {
$('import-data').onclick = function(event) {
ImportDataOverlay.show();
// Default browser section.
if (!cr.isChromeOS) {
+ if (!loadTimeData.getBoolean('showSetDefault')) {
+ $('set-default-browser-section').hidden = true;
+ }
$('set-as-default-browser').onclick = function(event) {
chrome.send('becomeDefaultBrowser');
};
Preferences.getInstance().addEventListener(
$('accessibility-autoclick-check').getAttribute('pref'),
updateDelayDropdown);
-
- $('accessibility-sticky-keys').hidden =
- !loadTimeData.getBoolean('enableStickyKeys');
}
// Display management section (CrOS only).
* See showSectionWithAnimation_.
*/
toggleSectionWithAnimation_: function(section, container) {
- if (section.style.height == '')
+ if (section.style.height == '' || section.style.height == '0px')
this.showSectionWithAnimation_(section, container);
else
this.hideSectionWithAnimation_(section, container);
if (!syncData.signinAllowed &&
(!syncData.supervisedUser || !cr.isChromeOS)) {
$('sync-section').hidden = true;
+ $('sync-users-section').hidden =
+ $('profiles-section').hidden &&
+ $('sync-section').hidden &&
+ $('profiles-supervised-dashboard-tip').hidden;
return;
}
$('sync-section').hidden = false;
+ $('sync-users-section').hidden = false;
var subSection = $('sync-section').firstChild;
while (subSection) {
* users.
*/
updateManagesSupervisedUsers_: function(value) {
- $('profiles-supervised-dashboard-tip').hidden = !value;
+ if (value) {
+ $('profiles-supervised-dashboard-tip').hidden = false;
+ } else {
+ $('profiles-supervised-dashboard-tip').hidden = true;
+ }
+ $('sync-users-section').hidden =
+ $('profiles-section').hidden &&
+ $('sync-section').hidden &&
+ $('profiles-supervised-dashboard-tip').hidden;
},
/**
},
/**
- * Event listener for the 'hotword search enabled' preference. Shows/hides
- * the UI for updating hotword settings..
- * @param {Event} event The preference change event.
- */
- onHotwordSearchPrefChanged_: function(event) {
- var section = $('hotword-settings-section');
- var container = $('hotword-settings-section-container');
- // event.value is a dictionary with details about the preference that was
- // changed. Within that dictionary, |value| is the new value of the
- // preference. In this case, the preference represents a Boolean so it
- // can be checked for true/false.
- if (event.value.value)
- this.showSectionWithAnimation_(section, container);
- else
- this.hideSectionWithAnimation_(section, container);
- },
-
- /**
* Event listener for the 'homepage is NTP' preference. Updates the label
* next to the 'Change' button.
* @param {Event} event The preference change event.
onDefaultDownloadDirectoryChanged_: function(event) {
$('downloadLocationPath').value = event.value.value;
if (cr.isChromeOS) {
- // On ChromeOS, replace /special/drive/root with Drive for drive paths,
- // /home/chronos/user/Downloads or /home/chronos/u-<hash>/Downloads
- // with Downloads for local paths, and '/' with ' \u203a ' (angled quote
- // sign) everywhere. The modified path is used only for display purpose.
+ // On ChromeOS, replace /special/drive-<hash>/root with "Google Drive"
+ // for remote files, /home/chronos/user/Downloads or
+ // /home/chronos/u-<hash>/Downloads with "Downloads" for local paths,
+ // and '/' with ' \u203a ' (angled quote sign) everywhere. The modified
+ // path is used only for display purpose.
var path = $('downloadLocationPath').value;
- path = path.replace(/^\/special\/drive\/root/, 'Google Drive');
+ path = path.replace(/^\/special\/drive[^\/]*\/root/, 'Google Drive');
path = path.replace(/^\/home\/chronos\/(user|u-[^\/]*)\//, '');
path = path.replace(/\//g, ' \u203a ');
$('downloadLocationPath').value = path;