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

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 800523002: [Hotword] Sync Audio History pref every 24 hours, when opening chrome://settings and . . . (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 cr.exportPath('options'); 5 cr.exportPath('options');
6 6
7 /** 7 /**
8 * @typedef {{actionLinkText: (string|undefined), 8 * @typedef {{actionLinkText: (string|undefined),
9 * childUser: (boolean|undefined), 9 * childUser: (boolean|undefined),
10 * hasError: (boolean|undefined), 10 * hasError: (boolean|undefined),
(...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1214 * Updates the visibility of the 'retrain' link. 1214 * Updates the visibility of the 'retrain' link.
1215 * @param {Event} event The preference change event. 1215 * @param {Event} event The preference change event.
1216 * @private 1216 * @private
1217 */ 1217 */
1218 onHotwordAlwaysOnChanged_: function(event) { 1218 onHotwordAlwaysOnChanged_: function(event) {
1219 this.setHotwordRetrainLinkVisible_(event.value.value); 1219 this.setHotwordRetrainLinkVisible_(event.value.value);
1220 }, 1220 },
1221 1221
1222 /** 1222 /**
1223 * Activates the Audio History section of the Settings page. 1223 * Activates the Audio History section of the Settings page.
1224 * @param {boolean} visible Whether the audio history section is visible.
1224 * @param {boolean} alwaysOn Whether always-on hotwording is available. 1225 * @param {boolean} alwaysOn Whether always-on hotwording is available.
1225 * @param {string} labelText Text describing current audio history state. 1226 * @param {string} labelText Text describing current audio history state.
1226 * @private 1227 * @private
1227 */ 1228 */
1228 showAudioHistorySection_: function(alwaysOn, labelText) { 1229 setAudioHistorySectionVisible_: function(visible, alwaysOn, labelText) {
1229 $('audio-history').hidden = false; 1230 $('audio-history').hidden = !visible;
1230 $('audio-history-label').textContent = labelText; 1231 $('audio-history-label').textContent = labelText;
1231 $('audio-history-always-on-description').hidden = !alwaysOn; 1232 $('audio-history-always-on-description').hidden = !alwaysOn;
1232 }, 1233 },
1233 1234
1234 /** 1235 /**
1235 * Event listener for the 'homepage is NTP' preference. Updates the label 1236 * Event listener for the 'homepage is NTP' preference. Updates the label
1236 * next to the 'Change' button. 1237 * next to the 'Change' button.
1237 * @param {Event} event The preference change event. 1238 * @param {Event} event The preference change event.
1238 */ 1239 */
1239 onHomePageIsNtpChanged_: function(event) { 1240 onHomePageIsNtpChanged_: function(event) {
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after
2122 'setHighContrastCheckboxState', 2123 'setHighContrastCheckboxState',
2123 'setAllHotwordSectionsVisible', 2124 'setAllHotwordSectionsVisible',
2124 'setMetricsReportingCheckboxState', 2125 'setMetricsReportingCheckboxState',
2125 'setMetricsReportingSettingVisibility', 2126 'setMetricsReportingSettingVisibility',
2126 'setProfilesInfo', 2127 'setProfilesInfo',
2127 'setSpokenFeedbackCheckboxState', 2128 'setSpokenFeedbackCheckboxState',
2128 'setThemesResetButtonEnabled', 2129 'setThemesResetButtonEnabled',
2129 'setVirtualKeyboardCheckboxState', 2130 'setVirtualKeyboardCheckboxState',
2130 'setupPageZoomSelector', 2131 'setupPageZoomSelector',
2131 'setupProxySettingsButton', 2132 'setupProxySettingsButton',
2132 'showAudioHistorySection', 2133 'setAudioHistorySectionVisible',
2133 'showBluetoothSettings', 2134 'showBluetoothSettings',
2134 'showCreateProfileError', 2135 'showCreateProfileError',
2135 'showCreateProfileSuccess', 2136 'showCreateProfileSuccess',
2136 'showCreateProfileWarning', 2137 'showCreateProfileWarning',
2137 'showHotwordAlwaysOnSection', 2138 'showHotwordAlwaysOnSection',
2138 'showHotwordNoDspSection', 2139 'showHotwordNoDspSection',
2139 'showHotwordSection', 2140 'showHotwordSection',
2140 'showMouseControls', 2141 'showMouseControls',
2141 'showSupervisedUserImportError', 2142 'showSupervisedUserImportError',
2142 'showSupervisedUserImportSuccess', 2143 'showSupervisedUserImportSuccess',
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 } 2198 }
2198 button.textContent = loadTimeData.getString(strId); 2199 button.textContent = loadTimeData.getString(strId);
2199 }; 2200 };
2200 } 2201 }
2201 2202
2202 // Export 2203 // Export
2203 return { 2204 return {
2204 BrowserOptions: BrowserOptions 2205 BrowserOptions: BrowserOptions
2205 }; 2206 };
2206 }); 2207 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698