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

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

Issue 2238163002: [MD History] Add UMA stats for switching views and the CBD button. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@start_focus_in_search_bar
Patch Set: fix_test Created 4 years, 4 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/list_container.js
diff --git a/chrome/browser/resources/md_history/list_container.js b/chrome/browser/resources/md_history/list_container.js
index a51787135c588a8fee81fe69f97e72c36600f808..b4e348a68351d78023581b87fa98670d52512677 100644
--- a/chrome/browser/resources/md_history/list_container.js
+++ b/chrome/browser/resources/md_history/list_container.js
@@ -12,6 +12,9 @@ Polymer({
// Whether domain-grouped history is enabled.
grouped: Boolean,
+ /** @type {HistoryRange} */
+ groupedRange: {type: Number, observer: 'groupedRangeChanged_'},
+
/** @type {!QueryState} */
queryState: Object,
@@ -19,10 +22,6 @@ Polymer({
queryResult: Object,
},
- observers: [
- 'groupedRangeChanged_(queryState.range)',
- ],
-
listeners: {
'history-list-scrolled': 'closeMenu_',
'load-more-history': 'loadMoreHistory_',
@@ -80,7 +79,7 @@ Polymer({
}
var maxResults =
- queryState.range == HistoryRange.ALL_TIME ? RESULTS_PER_PAGE : 0;
+ this.groupedRange == HistoryRange.ALL_TIME ? RESULTS_PER_PAGE : 0;
chrome.send('queryHistory', [
queryState.searchTerm, queryState.groupedOffset, queryState.range,
lastVisitTime, maxResults
@@ -123,11 +122,15 @@ Polymer({
* @param {HistoryRange} range
* @private
*/
- groupedRangeChanged_: function(range) {
- this.selectedPage_ = this.queryState.range == HistoryRange.ALL_TIME ?
+ groupedRangeChanged_: function(range, oldRange) {
+ this.selectedPage_ = range == HistoryRange.ALL_TIME ?
'infinite-list' : 'grouped-list';
+ if (oldRange == undefined)
+ return;
+
this.queryHistory(false);
+ this.fire('history-view-changed');
},
/** @private */
« no previous file with comments | « chrome/browser/resources/md_history/list_container.html ('k') | chrome/browser/resources/md_history/side_bar.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698