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

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

Issue 938713004: Add Now setting and migration logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style comments from robliao@ Created 5 years, 10 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 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 HotwordSearchSettingIndicator.decorate( 239 HotwordSearchSettingIndicator.decorate(
240 $('hotword-search-setting-indicator')); 240 $('hotword-search-setting-indicator'));
241 HotwordSearchSettingIndicator.decorate( 241 HotwordSearchSettingIndicator.decorate(
242 $('hotword-no-dsp-search-setting-indicator')); 242 $('hotword-no-dsp-search-setting-indicator'));
243 var hotwordIndicator = $('hotword-always-on-search-setting-indicator'); 243 var hotwordIndicator = $('hotword-always-on-search-setting-indicator');
244 HotwordSearchSettingIndicator.decorate(hotwordIndicator); 244 HotwordSearchSettingIndicator.decorate(hotwordIndicator);
245 hotwordIndicator.disabledOnErrorSection = 245 hotwordIndicator.disabledOnErrorSection =
246 $('hotword-always-on-search-checkbox'); 246 $('hotword-always-on-search-checkbox');
247 chrome.send('requestHotwordAvailable'); 247 chrome.send('requestHotwordAvailable');
248 248
249 chrome.send('requestGoogleNowAvailable');
250
249 if ($('set-wallpaper')) { 251 if ($('set-wallpaper')) {
250 $('set-wallpaper').onclick = function(event) { 252 $('set-wallpaper').onclick = function(event) {
251 chrome.send('openWallpaperManager'); 253 chrome.send('openWallpaperManager');
252 chrome.send('coreOptionsUserMetricsAction', 254 chrome.send('coreOptionsUserMetricsAction',
253 ['Options_OpenWallpaperManager']); 255 ['Options_OpenWallpaperManager']);
254 }; 256 };
255 } 257 }
256 258
257 // Control the hotword-always-on pref with the Hotword Audio 259 // Control the hotword-always-on pref with the Hotword Audio
258 // Verification app. 260 // Verification app.
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1243 * Event listener for the 'hotword always on search enabled' preference. 1245 * Event listener for the 'hotword always on search enabled' preference.
1244 * Updates the visibility of the 'retrain' link. 1246 * Updates the visibility of the 'retrain' link.
1245 * @param {Event} event The preference change event. 1247 * @param {Event} event The preference change event.
1246 * @private 1248 * @private
1247 */ 1249 */
1248 onHotwordAlwaysOnChanged_: function(event) { 1250 onHotwordAlwaysOnChanged_: function(event) {
1249 this.setHotwordRetrainLinkVisible_(event.value.value); 1251 this.setHotwordRetrainLinkVisible_(event.value.value);
1250 }, 1252 },
1251 1253
1252 /** 1254 /**
1255 * Controls the visibility of the Now settings.
1256 * @param {boolean} visible Whether to show Now settings.
1257 * @private
1258 */
1259 setNowSectionVisible_: function(visible) {
1260 $('google-now-launcher').hidden = !visible;
1261 },
1262
1263 /**
1253 * Activates the Audio History section of the Settings page. 1264 * Activates the Audio History section of the Settings page.
1254 * @param {boolean} visible Whether the audio history section is visible. 1265 * @param {boolean} visible Whether the audio history section is visible.
1255 * @param {string} labelText Text describing current audio history state. 1266 * @param {string} labelText Text describing current audio history state.
1256 * @private 1267 * @private
1257 */ 1268 */
1258 setAudioHistorySectionVisible_: function(visible, labelText) { 1269 setAudioHistorySectionVisible_: function(visible, labelText) {
1259 $('audio-history').hidden = !visible; 1270 $('audio-history').hidden = !visible;
1260 $('audio-history-label').textContent = labelText; 1271 $('audio-history-label').textContent = labelText;
1261 }, 1272 },
1262 1273
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
2162 'setWallpaperManaged', 2173 'setWallpaperManaged',
2163 'setAutoOpenFileTypesDisplayed', 2174 'setAutoOpenFileTypesDisplayed',
2164 'setBatteryIcon', 2175 'setBatteryIcon',
2165 'setBatteryStatusText', 2176 'setBatteryStatusText',
2166 'setBluetoothState', 2177 'setBluetoothState',
2167 'setCanSetTime', 2178 'setCanSetTime',
2168 'setFontSize', 2179 'setFontSize',
2169 'setHotwordRetrainLinkVisible', 2180 'setHotwordRetrainLinkVisible',
2170 'setNativeThemeButtonEnabled', 2181 'setNativeThemeButtonEnabled',
2171 'setNetworkPredictionValue', 2182 'setNetworkPredictionValue',
2183 'setNowSectionVisible',
2172 'setHighContrastCheckboxState', 2184 'setHighContrastCheckboxState',
2173 'setAllHotwordSectionsVisible', 2185 'setAllHotwordSectionsVisible',
2174 'setMetricsReportingCheckboxState', 2186 'setMetricsReportingCheckboxState',
2175 'setMetricsReportingSettingVisibility', 2187 'setMetricsReportingSettingVisibility',
2176 'setProfilesInfo', 2188 'setProfilesInfo',
2177 'setSpokenFeedbackCheckboxState', 2189 'setSpokenFeedbackCheckboxState',
2178 'setThemesResetButtonEnabled', 2190 'setThemesResetButtonEnabled',
2179 'setVirtualKeyboardCheckboxState', 2191 'setVirtualKeyboardCheckboxState',
2180 'setupPageZoomSelector', 2192 'setupPageZoomSelector',
2181 'setupProxySettingsButton', 2193 'setupProxySettingsButton',
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 } 2259 }
2248 button.textContent = loadTimeData.getString(strId); 2260 button.textContent = loadTimeData.getString(strId);
2249 }; 2261 };
2250 } 2262 }
2251 2263
2252 // Export 2264 // Export
2253 return { 2265 return {
2254 BrowserOptions: BrowserOptions 2266 BrowserOptions: BrowserOptions
2255 }; 2267 };
2256 }); 2268 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698