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

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

Issue 797763002: [Hotword] Hotword and Audio History settings should reflect sync sign in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit and DCHECK 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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 'hotword-no-dsp-search', 1195 'hotword-no-dsp-search',
1196 'hotword-no-dsp-search-setting-indicator', 1196 'hotword-no-dsp-search-setting-indicator',
1197 opt_error); 1197 opt_error);
1198 }, 1198 },
1199 1199
1200 /** 1200 /**
1201 * Controls the visibility of all the hotword sections. 1201 * Controls the visibility of all the hotword sections.
1202 * @param {boolean} visible Whether to show hotword sections. 1202 * @param {boolean} visible Whether to show hotword sections.
1203 * @private 1203 * @private
1204 */ 1204 */
1205 setHotwordSectionVisible_: function(visible) { 1205 setAllHotwordSectionsVisible_: function(visible) {
1206 $('hotword-search').hidden = !visible; 1206 $('hotword-search').hidden = !visible;
1207 $('hotword-always-on-search').hidden = !visible; 1207 $('hotword-always-on-search').hidden = !visible;
1208 $('hotword-no-dsp-search').hidden = !visible; 1208 $('hotword-no-dsp-search').hidden = !visible;
1209 $('audio-history').hidden = !visible; 1209 $('audio-history').hidden = !visible;
1210 }, 1210 },
1211 1211
1212 /** 1212 /**
1213 * Shows or hides the hotword retrain link 1213 * Shows or hides the hotword retrain link
1214 * @param {boolean} visible Whether to show the link. 1214 * @param {boolean} visible Whether to show the link.
1215 * @private 1215 * @private
1216 */ 1216 */
1217 setHotwordRetrainLinkVisible_: function(visible) { 1217 setHotwordRetrainLinkVisible_: function(visible) {
1218 $('hotword-retrain-link').hidden = !visible; 1218 $('hotword-retrain-link').hidden = !visible;
1219 }, 1219 },
1220 1220
1221 /** 1221 /**
1222 * Event listener for the 'hotword always on search enabled' preference. 1222 * Event listener for the 'hotword always on search enabled' preference.
1223 * Updates the visibility of the 'retrain' link. 1223 * Updates the visibility of the 'retrain' link.
1224 * @param {Event} event The preference change event. 1224 * @param {Event} event The preference change event.
1225 * @private 1225 * @private
1226 */ 1226 */
1227 onHotwordAlwaysOnChanged_: function(event) { 1227 onHotwordAlwaysOnChanged_: function(event) {
1228 this.setHotwordRetrainLinkVisible_(event.value.value); 1228 this.setHotwordRetrainLinkVisible_(event.value.value);
1229 }, 1229 },
1230 1230
1231 /** 1231 /**
1232 * Activates the Audio History section of the Settings page. 1232 * Activates the Audio History section of the Settings page.
1233 * @param {boolean} alwaysOn Whether always-on hotwording is available. 1233 * @param {boolean} alwaysOn Whether always-on hotwording is available.
1234 * @param {string} labelText Text describing current audio history state.
1234 * @private 1235 * @private
1235 */ 1236 */
1236 showAudioHistorySection_: function(alwaysOn) { 1237 showAudioHistorySection_: function(alwaysOn, labelText) {
1237 $('audio-history').hidden = false; 1238 $('audio-history').hidden = false;
1239 $('audio-history-label').textContent = labelText;
1238 $('audio-history-always-on-description').hidden = !alwaysOn; 1240 $('audio-history-always-on-description').hidden = !alwaysOn;
1239 }, 1241 },
1240 1242
1241 /** 1243 /**
1242 * Event listener for the 'homepage is NTP' preference. Updates the label 1244 * Event listener for the 'homepage is NTP' preference. Updates the label
1243 * next to the 'Change' button. 1245 * next to the 'Change' button.
1244 * @param {Event} event The preference change event. 1246 * @param {Event} event The preference change event.
1245 */ 1247 */
1246 onHomePageIsNtpChanged_: function(event) { 1248 onHomePageIsNtpChanged_: function(event) {
1247 if (!event.value.uncommitted) { 1249 if (!event.value.uncommitted) {
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 'setAutoOpenFileTypesDisplayed', 2122 'setAutoOpenFileTypesDisplayed',
2121 'setBatteryIcon', 2123 'setBatteryIcon',
2122 'setBatteryStatusText', 2124 'setBatteryStatusText',
2123 'setBluetoothState', 2125 'setBluetoothState',
2124 'setCanSetTime', 2126 'setCanSetTime',
2125 'setFontSize', 2127 'setFontSize',
2126 'setHotwordRetrainLinkVisible', 2128 'setHotwordRetrainLinkVisible',
2127 'setNativeThemeButtonEnabled', 2129 'setNativeThemeButtonEnabled',
2128 'setNetworkPredictionValue', 2130 'setNetworkPredictionValue',
2129 'setHighContrastCheckboxState', 2131 'setHighContrastCheckboxState',
2130 'setHotwordSectionVisible', 2132 'setAllHotwordSectionsVisible',
2131 'setMetricsReportingCheckboxState', 2133 'setMetricsReportingCheckboxState',
2132 'setMetricsReportingSettingVisibility', 2134 'setMetricsReportingSettingVisibility',
2133 'setProfilesInfo', 2135 'setProfilesInfo',
2134 'setSpokenFeedbackCheckboxState', 2136 'setSpokenFeedbackCheckboxState',
2135 'setThemesResetButtonEnabled', 2137 'setThemesResetButtonEnabled',
2136 'setVirtualKeyboardCheckboxState', 2138 'setVirtualKeyboardCheckboxState',
2137 'setupPageZoomSelector', 2139 'setupPageZoomSelector',
2138 'setupProxySettingsButton', 2140 'setupProxySettingsButton',
2139 'showAudioHistorySection', 2141 'showAudioHistorySection',
2140 'showBluetoothSettings', 2142 'showBluetoothSettings',
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
2204 } 2206 }
2205 button.textContent = loadTimeData.getString(strId); 2207 button.textContent = loadTimeData.getString(strId);
2206 }; 2208 };
2207 } 2209 }
2208 2210
2209 // Export 2211 // Export
2210 return { 2212 return {
2211 BrowserOptions: BrowserOptions 2213 BrowserOptions: BrowserOptions
2212 }; 2214 };
2213 }); 2215 });
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/browser_options.html ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698