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

Unified Diff: chrome/browser/resources/settings/search_page/search_page.js

Issue 2804593003: MD Settings: Search engine: Request hotword info on engine change (Closed)
Patch Set: Fix tests Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/search_page_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/settings/search_page/search_page.js
diff --git a/chrome/browser/resources/settings/search_page/search_page.js b/chrome/browser/resources/settings/search_page/search_page.js
index 01f0016cf2aa8566fe10aba79a439b7136624925..edcf246a4aee9dae75b9b7fc3c32406af85ebb59 100644
--- a/chrome/browser/resources/settings/search_page/search_page.js
+++ b/chrome/browser/resources/settings/search_page/search_page.js
@@ -54,16 +54,14 @@ Polymer({
// Omnibox search engine
var updateSearchEngines = function(searchEngines) {
this.set('searchEngines_', searchEngines.defaults);
+ this.requestHotwordInfoUpdate_();
}.bind(this);
this.browserProxy_.getSearchEnginesList().then(updateSearchEngines);
cr.addWebUIListener('search-engines-changed', updateSearchEngines);
- // Hotword (OK Google)
+ // Hotword (OK Google) listener
cr.addWebUIListener(
'hotword-info-update', this.hotwordInfoUpdate_.bind(this));
- this.browserProxy_.getHotwordInfo().then(function(hotwordInfo) {
- this.hotwordInfoUpdate_(hotwordInfo);
- }.bind(this));
// Google Now cards in the launcher
cr.addWebUIListener(
@@ -101,6 +99,13 @@ Polymer({
!!this.hotwordSearchEnablePref_.value);
},
+ /** @private */
+ requestHotwordInfoUpdate_: function() {
+ this.browserProxy_.getHotwordInfo().then(function(hotwordInfo) {
+ this.hotwordInfoUpdate_(hotwordInfo);
+ }.bind(this));
+ },
+
/**
* @param {!SearchPageHotwordInfo} hotwordInfo
* @private
« no previous file with comments | « no previous file | chrome/test/data/webui/settings/search_page_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698