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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2032313002: MD WebUI: Add loading spinner to cr-toolbar, hook into MD History toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename function and property Created 4 years, 6 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/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index a16204324a4bf4384f0b4b5fb8b3d1c2846d2305..fa0a15669186af4175b3cb2c3629b0a4966aa1d0 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -40,6 +40,8 @@ Polymer({
querying: true,
searchTerm: '',
results: null,
+ // Whether the most recent query was incremental.
+ incremental: false,
dpapad 2016/06/08 00:07:35 Shouldn't the QueryState typedef also be upadated?
tsergeant 2016/06/08 02:53:54 Done.
info: null,
range: HistoryRange.ALL_TIME,
// TODO(calamity): Make history toolbar buttons change the offset.
@@ -175,6 +177,7 @@ Polymer({
return;
this.set('queryState_.querying', true);
+ this.set('queryState_.incremental', incremental);
var queryState = this.queryState_;
@@ -211,7 +214,20 @@ Polymer({
return selectedPage;
},
- syncedTabsSelected_(selectedPage) {
+ syncedTabsSelected_: function(selectedPage) {
dpapad 2016/06/08 00:07:35 Same here.
tsergeant 2016/06/08 02:53:54 Done.
return selectedPage == 'history-synced-device-manager';
+ },
+
+ /**
+ * True if the toolbar should show a loading spinner. True when the backend is
+ * querying a new search term.
+ * @param {boolean} querying
+ * @param {boolean} incremental
+ * @param {string} searchTerm
+ * @return {boolean}
dpapad 2016/06/08 00:07:36 Nit: Move the comment at lines 222-223 here, as fo
tsergeant 2016/06/08 02:53:54 Done.
+ * @private
+ */
+ shouldShowSpinner_: function(querying, incremental, searchTerm) {
+ return querying && !incremental && searchTerm != '';
}
});
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/history_toolbar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698