Index: chrome/browser/resources/options/browser_options.js |
diff --git a/chrome/browser/resources/options/browser_options.js b/chrome/browser/resources/options/browser_options.js |
index c0346e3c965a4c056335338bc7c9ff0e85941f5a..0871c7bbb9a066f7954a4ea202f66e930ff6a4ee 100644 |
--- a/chrome/browser/resources/options/browser_options.js |
+++ b/chrome/browser/resources/options/browser_options.js |
@@ -128,6 +128,10 @@ cr.define('options', function() { |
OptionsPage.navigateToPage('homePageOverlay'); |
}; |
+ chrome.send('requestHotwordAvailabile'); |
James Hawkins
2014/01/14 00:53:50
It's not clear how this call is tied to the added
rpetterson
2014/01/14 21:54:17
Good point. I've swapped the order of them. Now, w
|
+ Preferences.getInstance().addEventListener('hotword.search_enabled', |
+ this.onHotwordSearchPrefChanged_.bind(this)); |
+ |
if ($('set-wallpaper')) { |
$('set-wallpaper').onclick = function(event) { |
chrome.send('openWallpaperManager'); |
@@ -866,6 +870,28 @@ cr.define('options', function() { |
}, |
/** |
+ * Activates the Hotword section from the System settings page. |
+ * @private |
+ */ |
+ showHotwordSection_: function() { |
+ $('hotword-search').hidden = false; |
+ }, |
+ |
+ /** |
+ * Event listener for the 'hotword search enabled' preference. Shows/hides |
+ * the UI for updating hotword settings with animation. |
James Hawkins
2014/01/14 00:53:50
Do we need the 'with animation' part (in the comme
rpetterson
2014/01/14 21:54:17
Done.
|
+ * @param {Event} event The preference change event. |
+ */ |
+ onHotwordSearchPrefChanged_: function(event) { |
+ var section = $('hotword-settings-section'); |
+ var container = $('hotword-settings-section-container'); |
+ if (event.value.value) |
James Hawkins
2014/01/14 00:53:50
Can you document what event.value.value represents
rpetterson
2014/01/14 21:54:17
Done.
|
+ 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. |
@@ -1573,6 +1599,7 @@ cr.define('options', function() { |
'showCreateProfileError', |
'showCreateProfileSuccess', |
'showCreateProfileWarning', |
+ 'showHotwordSection', |
'showManagedUserImportError', |
'showManagedUserImportSuccess', |
'showMouseControls', |