OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * 'settings-search-page' is the settings page containing search settings. | 7 * 'settings-search-page' is the settings page containing search settings. |
8 */ | 8 */ |
9 Polymer({ | 9 Polymer({ |
10 is: 'settings-search-page', | 10 is: 'settings-search-page', |
(...skipping 24 matching lines...) Expand all Loading... |
35 * hotword search is actually enabled). | 35 * hotword search is actually enabled). |
36 * @private {!chrome.settingsPrivate.PrefObject|undefined} | 36 * @private {!chrome.settingsPrivate.PrefObject|undefined} |
37 */ | 37 */ |
38 hotwordSearchEnablePref_: Object, | 38 hotwordSearchEnablePref_: Object, |
39 | 39 |
40 /** @private */ | 40 /** @private */ |
41 googleNowAvailable_: Boolean, | 41 googleNowAvailable_: Boolean, |
42 | 42 |
43 /** @type {?Map<string, string>} */ | 43 /** @type {?Map<string, string>} */ |
44 focusConfig_: Object, | 44 focusConfig_: Object, |
| 45 |
| 46 // <if expr="chromeos"> |
| 47 /** @private */ |
| 48 voiceInteractionFeatureEnabled_: { |
| 49 type: Boolean, |
| 50 notify: true, |
| 51 value: function() { |
| 52 return loadTimeData.getBoolean('enableVoiceInteraction'); |
| 53 }, |
| 54 } |
| 55 // </if> |
45 }, | 56 }, |
46 | 57 |
47 /** @private {?settings.SearchEnginesBrowserProxy} */ | 58 /** @private {?settings.SearchEnginesBrowserProxy} */ |
48 browserProxy_: null, | 59 browserProxy_: null, |
49 | 60 |
50 /** @override */ | 61 /** @override */ |
51 created: function() { | 62 created: function() { |
52 this.browserProxy_ = settings.SearchEnginesBrowserProxyImpl.getInstance(); | 63 this.browserProxy_ = settings.SearchEnginesBrowserProxyImpl.getInstance(); |
53 }, | 64 }, |
54 | 65 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 /** @private */ | 103 /** @private */ |
93 onDisableExtension_: function() { | 104 onDisableExtension_: function() { |
94 this.fire('refresh-pref', 'default_search_provider.enabled'); | 105 this.fire('refresh-pref', 'default_search_provider.enabled'); |
95 }, | 106 }, |
96 | 107 |
97 /** @private */ | 108 /** @private */ |
98 onManageSearchEnginesTap_: function() { | 109 onManageSearchEnginesTap_: function() { |
99 settings.navigateTo(settings.routes.SEARCH_ENGINES); | 110 settings.navigateTo(settings.routes.SEARCH_ENGINES); |
100 }, | 111 }, |
101 | 112 |
| 113 /** @private */ |
| 114 onGoogleAssistantTap_: function() { |
| 115 settings.navigateTo(settings.routes.GOOGLE_ASSISTANT); |
| 116 }, |
| 117 |
102 /** | 118 /** |
103 * @param {!Event} event | 119 * @param {!Event} event |
104 * @private | 120 * @private |
105 */ | 121 */ |
106 onHotwordSearchEnableChange_: function(event) { | 122 onHotwordSearchEnableChange_: function(event) { |
107 // Do not set the pref directly, allow Chrome to run the setup app instead. | 123 // Do not set the pref directly, allow Chrome to run the setup app instead. |
108 this.browserProxy_.setHotwordSearchEnabled( | 124 this.browserProxy_.setHotwordSearchEnabled( |
109 !!this.hotwordSearchEnablePref_.value); | 125 !!this.hotwordSearchEnablePref_.value); |
110 }, | 126 }, |
111 | 127 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 getShowHotwordError_: function() { | 178 getShowHotwordError_: function() { |
163 return this.hotwordInfo_.enabled && !!this.hotwordInfo_.errorMessage; | 179 return this.hotwordInfo_.enabled && !!this.hotwordInfo_.errorMessage; |
164 }, | 180 }, |
165 | 181 |
166 /** @private */ | 182 /** @private */ |
167 onRetrainTap_: function() { | 183 onRetrainTap_: function() { |
168 // Re-enable hotword search enable; this will trigger the retrain UI. | 184 // Re-enable hotword search enable; this will trigger the retrain UI. |
169 this.browserProxy_.setHotwordSearchEnabled(this.hotwordInfo_.enabled); | 185 this.browserProxy_.setHotwordSearchEnabled(this.hotwordInfo_.enabled); |
170 }, | 186 }, |
171 | 187 |
| 188 // <if expr="chromeos"> |
| 189 /** |
| 190 * @param {boolean} assistantEnabled |
| 191 * @return {boolean} |
| 192 * @private |
| 193 */ |
| 194 getAssistantEnabledDisabledLabel_: function(toggleValue) { |
| 195 return this.i18n(toggleValue ? 'searchGoogleAssistantEnabled' : |
| 196 'searchGoogleAssistantDisabled'); |
| 197 }, |
| 198 // </if> |
| 199 |
172 /** | 200 /** |
173 * @param {!Event} event | 201 * @param {!Event} event |
174 * @private | 202 * @private |
175 */ | 203 */ |
176 doNothing_: function(event) { | 204 doNothing_: function(event) { |
177 event.stopPropagation(); | 205 event.stopPropagation(); |
178 }, | 206 }, |
179 | 207 |
180 /** | 208 /** |
181 * @param {!chrome.settingsPrivate.PrefObject} pref | 209 * @param {!chrome.settingsPrivate.PrefObject} pref |
182 * @return {boolean} | 210 * @return {boolean} |
183 * @private | 211 * @private |
184 */ | 212 */ |
185 isDefaultSearchControlledByPolicy_: function(pref) { | 213 isDefaultSearchControlledByPolicy_: function(pref) { |
186 return pref.controlledBy == chrome.settingsPrivate.ControlledBy.USER_POLICY; | 214 return pref.controlledBy == chrome.settingsPrivate.ControlledBy.USER_POLICY; |
187 }, | 215 }, |
188 | 216 |
189 /** | 217 /** |
190 * @param {!chrome.settingsPrivate.PrefObject} pref | 218 * @param {!chrome.settingsPrivate.PrefObject} pref |
191 * @return {boolean} | 219 * @return {boolean} |
192 * @private | 220 * @private |
193 */ | 221 */ |
194 isDefaultSearchEngineEnforced_: function(pref) { | 222 isDefaultSearchEngineEnforced_: function(pref) { |
195 return pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED; | 223 return pref.enforcement == chrome.settingsPrivate.Enforcement.ENFORCED; |
196 }, | 224 }, |
197 }); | 225 }); |
OLD | NEW |