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

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

Issue 2572963004: MD Settings: Add "Show Google Now cards in the launcher" row in Search section. (Closed)
Patch Set: Rebase Created 4 years 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
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 675730ba1462de360a42d39015c8f52ea1397338..01f0016cf2aa8566fe10aba79a439b7136624925 100644
--- a/chrome/browser/resources/settings/search_page/search_page.js
+++ b/chrome/browser/resources/settings/search_page/search_page.js
@@ -36,6 +36,9 @@ Polymer({
* @private {!chrome.settingsPrivate.PrefObject|undefined}
*/
hotwordSearchEnablePref_: Object,
+
+ /** @private */
+ googleNowAvailable_: Boolean,
},
/** @private {?settings.SearchEnginesBrowserProxy} */
@@ -61,6 +64,14 @@ Polymer({
this.browserProxy_.getHotwordInfo().then(function(hotwordInfo) {
this.hotwordInfoUpdate_(hotwordInfo);
}.bind(this));
+
+ // Google Now cards in the launcher
+ cr.addWebUIListener(
+ 'google-now-availability-changed',
+ this.googleNowAvailabilityUpdate_.bind(this));
+ this.browserProxy_.getGoogleNowAvailability().then(function(available) {
+ this.googleNowAvailabilityUpdate_(available);
+ }.bind(this));
},
/** @private */
@@ -104,6 +115,14 @@ Polymer({
},
/**
+ * @param {boolean} available
+ * @private
+ */
+ googleNowAvailabilityUpdate_: function(available) {
+ this.googleNowAvailable_ = available;
+ },
+
+ /**
* @return {string}
* @private
*/

Powered by Google App Engine
This is Rietveld 408576698