Chromium Code Reviews| 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 bc621f34e9f9a940584a7f59a267340c3c3c64cf..4684864d1ada00a90473cd36b52a82811198caee 100644 |
| --- a/chrome/browser/resources/settings/settings_main/settings_main.js |
| +++ b/chrome/browser/resources/settings/settings_main/settings_main.js |
| @@ -195,6 +195,8 @@ Polymer({ |
| * @param {string} query |
|
michaelpg
2016/07/30 05:38:44
@return
dpapad
2016/08/01 21:23:06
Done.
|
| */ |
| searchContents: function(query) { |
| + var promiseResolver = new PromiseResolver(); |
|
michaelpg
2016/07/30 05:38:44
this promise/setTimeout business is scary, if we'r
michaelpg
2016/07/30 05:38:44
ok, after looking over it... we're resolving this
dpapad
2016/08/01 21:23:06
Removed PromiseResolver. Yes, it was used to avoid
|
| + |
| this.ensureInDefaultSearchPage_(); |
| this.toolbarSpinnerActive = true; |
| @@ -213,14 +215,18 @@ Polymer({ |
| // Nothing to do here. A previous search request was canceled |
| // because a new search request was issued before the first one |
| // completed. |
| + promiseResolver.resolve(); |
|
michaelpg
2016/07/30 05:38:44
we should just resolve this before the if so we do
dpapad
2016/08/01 21:23:06
Done.
|
| return; |
| } |
| this.toolbarSpinnerActive = false; |
| this.showNoResultsFound_ = |
| !request.isSame('') && !request.didFindMatches(); |
| + promiseResolver.resolve(); |
| }.bind(this)); |
| }.bind(this), 0); |
| + |
| + return promiseResolver.promise; |
| }, |
| /** |