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

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

Issue 2449663002: MD Settings: Implement search URLs. (Closed)
Patch Set: Rebase Created 4 years, 2 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
Index: chrome/browser/resources/settings/settings_main/settings_main.js
diff --git a/chrome/browser/resources/settings/settings_main/settings_main.js b/chrome/browser/resources/settings/settings_main/settings_main.js
index d090cdedbb16ce619799256543678264361d0e9d..9c90f5b576e9f0c6195ae90f3398d036dafc9b23 100644
--- a/chrome/browser/resources/settings/settings_main/settings_main.js
+++ b/chrome/browser/resources/settings/settings_main/settings_main.js
@@ -86,6 +86,13 @@ Polymer({
type: Object,
value: function() { return {}; },
},
+
+ /** @private */
+ searchQuery: {
tommycli 2016/11/01 21:05:26 Looks like settings-ui is messing with this. In th
dpapad 2016/11/01 22:02:02 Removed searchQuery property per suggestion.
+ type: String,
+ value: '',
+ observer: 'searchQueryChanged_',
+ },
},
/** @override */
@@ -206,6 +213,19 @@ Polymer({
this.updatePagesShown_();
},
+ /**
+ * @param {string} current
+ * @param {string} previous
+ * @private
+ */
+ searchQueryChanged_: function(current, previous) {
+ // Ignore change triggered by initialization.
+ if (previous == undefined)
+ return;
+
+ this.searchContents(this.searchQuery);
+ },
+
/** @private */
onSubpageExpand_: function() {
// The subpage finished expanding fully. Hide pages other than the current
@@ -313,22 +333,12 @@ Polymer({
},
/**
- * Navigates to the default search page (if necessary).
- * @private
- */
- ensureInDefaultSearchPage_: function() {
- if (settings.getCurrentRoute() != settings.Route.BASIC)
- settings.navigateTo(settings.Route.BASIC);
- },
-
- /**
* @param {string} query
* @return {!Promise} A promise indicating that searching finished.
*/
searchContents: function(query) {
// Trigger rendering of the basic and advanced pages and search once ready.
this.inSearchMode_ = true;
- this.ensureInDefaultSearchPage_();
this.toolbarSpinnerActive = true;
return new Promise(function(resolve, reject) {

Powered by Google App Engine
This is Rietveld 408576698