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

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: Closure comments 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..93f805653292a613e3cc88f2c9e31bbb1b6a2616 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -7,6 +7,7 @@
* searchTerm: string,
* results: ?Array<!HistoryEntry>,
* info: ?HistoryQuery,
+ * incremental: boolean,
* range: HistoryRange,
* groupedOffset: number,
* sessionList: ?Array<!ForeignSession>}}
@@ -40,6 +41,8 @@ Polymer({
querying: true,
searchTerm: '',
results: null,
+ // Whether the most recent query was incremental.
+ incremental: false,
info: null,
range: HistoryRange.ALL_TIME,
// TODO(calamity): Make history toolbar buttons change the offset.
@@ -64,6 +67,7 @@ Polymer({
'load-more-history': 'loadMoreHistory_',
},
+ /** @override */
ready: function() {
this.grouped_ = loadTimeData.getBoolean('groupByDomain');
},
@@ -175,6 +179,7 @@ Polymer({
return;
this.set('queryState_.querying', true);
+ this.set('queryState_.incremental', incremental);
var queryState = this.queryState_;
@@ -204,6 +209,11 @@ Polymer({
this.set('queryState_.sessionList', sessionList);
},
+ /**
+ * @param {string} selectedPage
+ * @param {HistoryRange} range
+ * @return {string}
+ */
getSelectedPage: function(selectedPage, range) {
if (selectedPage == 'history-list' && range != HistoryRange.ALL_TIME)
return 'history-grouped-list';
@@ -211,7 +221,24 @@ Polymer({
return selectedPage;
},
- syncedTabsSelected_(selectedPage) {
+ /**
+ * @param {string} selectedPage
+ * @return {boolean}
+ * @private
+ */
+ syncedTabsSelected_: function(selectedPage) {
return selectedPage == 'history-synced-device-manager';
+ },
+
+ /**
+ * @param {boolean} querying
+ * @param {boolean} incremental
+ * @param {string} searchTerm
+ * @return {boolean} Whether a loading spinner should be shown (implies the
+ * backend is querying a new search term).
+ * @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