OLD | NEW |
---|---|
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.define('options', function() { | 5 cr.define('options', function() { |
6 var OptionsPage = options.OptionsPage; | 6 var OptionsPage = options.OptionsPage; |
7 var ArrayDataModel = cr.ui.ArrayDataModel; | 7 var ArrayDataModel = cr.ui.ArrayDataModel; |
8 var RepeatingButton = cr.ui.RepeatingButton; | 8 var RepeatingButton = cr.ui.RepeatingButton; |
9 | 9 |
10 // | 10 // |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 | 121 |
122 Preferences.getInstance().addEventListener('homepage', | 122 Preferences.getInstance().addEventListener('homepage', |
123 this.onHomePageChanged_.bind(this)); | 123 this.onHomePageChanged_.bind(this)); |
124 Preferences.getInstance().addEventListener('homepage_is_newtabpage', | 124 Preferences.getInstance().addEventListener('homepage_is_newtabpage', |
125 this.onHomePageIsNtpChanged_.bind(this)); | 125 this.onHomePageIsNtpChanged_.bind(this)); |
126 | 126 |
127 $('change-home-page').onclick = function(event) { | 127 $('change-home-page').onclick = function(event) { |
128 OptionsPage.navigateToPage('homePageOverlay'); | 128 OptionsPage.navigateToPage('homePageOverlay'); |
129 }; | 129 }; |
130 | 130 |
131 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
| |
132 Preferences.getInstance().addEventListener('hotword.search_enabled', | |
133 this.onHotwordSearchPrefChanged_.bind(this)); | |
134 | |
131 if ($('set-wallpaper')) { | 135 if ($('set-wallpaper')) { |
132 $('set-wallpaper').onclick = function(event) { | 136 $('set-wallpaper').onclick = function(event) { |
133 chrome.send('openWallpaperManager'); | 137 chrome.send('openWallpaperManager'); |
134 }; | 138 }; |
135 } | 139 } |
136 | 140 |
137 $('themes-gallery').onclick = function(event) { | 141 $('themes-gallery').onclick = function(event) { |
138 window.open(loadTimeData.getString('themesGalleryURL')); | 142 window.open(loadTimeData.getString('themesGalleryURL')); |
139 }; | 143 }; |
140 $('themes-reset').onclick = function(event) { | 144 $('themes-reset').onclick = function(event) { |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
859 this.showSectionWithAnimation_(section, container); | 863 this.showSectionWithAnimation_(section, container); |
860 else | 864 else |
861 this.hideSectionWithAnimation_(section, container); | 865 this.hideSectionWithAnimation_(section, container); |
862 } else { | 866 } else { |
863 section.hidden = !event.value.value; | 867 section.hidden = !event.value.value; |
864 this.onShowHomeButtonChangedCalled_ = true; | 868 this.onShowHomeButtonChangedCalled_ = true; |
865 } | 869 } |
866 }, | 870 }, |
867 | 871 |
868 /** | 872 /** |
873 * Activates the Hotword section from the System settings page. | |
874 * @private | |
875 */ | |
876 showHotwordSection_: function() { | |
877 $('hotword-search').hidden = false; | |
878 }, | |
879 | |
880 /** | |
881 * Event listener for the 'hotword search enabled' preference. Shows/hides | |
882 * 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.
| |
883 * @param {Event} event The preference change event. | |
884 */ | |
885 onHotwordSearchPrefChanged_: function(event) { | |
886 var section = $('hotword-settings-section'); | |
887 var container = $('hotword-settings-section-container'); | |
888 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.
| |
889 this.showSectionWithAnimation_(section, container); | |
890 else | |
891 this.hideSectionWithAnimation_(section, container); | |
892 }, | |
893 | |
894 /** | |
869 * Event listener for the 'homepage is NTP' preference. Updates the label | 895 * Event listener for the 'homepage is NTP' preference. Updates the label |
870 * next to the 'Change' button. | 896 * next to the 'Change' button. |
871 * @param {Event} event The preference change event. | 897 * @param {Event} event The preference change event. |
872 */ | 898 */ |
873 onHomePageIsNtpChanged_: function(event) { | 899 onHomePageIsNtpChanged_: function(event) { |
874 if (!event.value.uncommitted) { | 900 if (!event.value.uncommitted) { |
875 $('home-page-url').hidden = event.value.value; | 901 $('home-page-url').hidden = event.value.value; |
876 $('home-page-ntp').hidden = !event.value.value; | 902 $('home-page-ntp').hidden = !event.value.value; |
877 } | 903 } |
878 }, | 904 }, |
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1566 'setSpokenFeedbackCheckboxState', | 1592 'setSpokenFeedbackCheckboxState', |
1567 'setThemesResetButtonEnabled', | 1593 'setThemesResetButtonEnabled', |
1568 'setVirtualKeyboardCheckboxState', | 1594 'setVirtualKeyboardCheckboxState', |
1569 'setupCloudPrintConnectorSection', | 1595 'setupCloudPrintConnectorSection', |
1570 'setupPageZoomSelector', | 1596 'setupPageZoomSelector', |
1571 'setupProxySettingsSection', | 1597 'setupProxySettingsSection', |
1572 'showBluetoothSettings', | 1598 'showBluetoothSettings', |
1573 'showCreateProfileError', | 1599 'showCreateProfileError', |
1574 'showCreateProfileSuccess', | 1600 'showCreateProfileSuccess', |
1575 'showCreateProfileWarning', | 1601 'showCreateProfileWarning', |
1602 'showHotwordSection', | |
1576 'showManagedUserImportError', | 1603 'showManagedUserImportError', |
1577 'showManagedUserImportSuccess', | 1604 'showManagedUserImportSuccess', |
1578 'showMouseControls', | 1605 'showMouseControls', |
1579 'showTouchpadControls', | 1606 'showTouchpadControls', |
1580 'updateAccountPicture', | 1607 'updateAccountPicture', |
1581 'updateAutoLaunchState', | 1608 'updateAutoLaunchState', |
1582 'updateDefaultBrowserState', | 1609 'updateDefaultBrowserState', |
1583 'updateManagesSupervisedUsers', | 1610 'updateManagesSupervisedUsers', |
1584 'updateSearchEngines', | 1611 'updateSearchEngines', |
1585 'updateStartupPages', | 1612 'updateStartupPages', |
(...skipping 14 matching lines...) Expand all Loading... | |
1600 BrowserOptions.getLoggedInUsername = function() { | 1627 BrowserOptions.getLoggedInUsername = function() { |
1601 return BrowserOptions.getInstance().username_; | 1628 return BrowserOptions.getInstance().username_; |
1602 }; | 1629 }; |
1603 } | 1630 } |
1604 | 1631 |
1605 // Export | 1632 // Export |
1606 return { | 1633 return { |
1607 BrowserOptions: BrowserOptions | 1634 BrowserOptions: BrowserOptions |
1608 }; | 1635 }; |
1609 }); | 1636 }); |
OLD | NEW |