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

Side by Side Diff: chrome/browser/resources/md_history/list_container.js

Issue 2248223003: Fixes broken history page when no item selected (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 Polymer({ 5 Polymer({
6 is: 'history-list-container', 6 is: 'history-list-container',
7 7
8 properties: { 8 properties: {
9 // The path of the currently selected page. 9 // The path of the currently selected page.
10 selectedPage_: String, 10 selectedPage_: String,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 lastVisitTime, maxResults 86 lastVisitTime, maxResults
87 ]); 87 ]);
88 }, 88 },
89 89
90 /** @return {number} */ 90 /** @return {number} */
91 getSelectedItemCount: function() { 91 getSelectedItemCount: function() {
92 return this.getSelectedList_().selectedPaths.size; 92 return this.getSelectedList_().selectedPaths.size;
93 }, 93 },
94 94
95 unselectAllItems: function(count) { 95 unselectAllItems: function(count) {
96 this.getSelectedList_().unselectAllItems(count); 96 var selectedList = this.getSelectedList_();
97 if (selectedList)
98 selectedList.unselectAllItems(count);
97 }, 99 },
98 100
99 /** 101 /**
100 * Delete all the currently selected history items. Will prompt the user with 102 * Delete all the currently selected history items. Will prompt the user with
101 * a dialog to confirm that the deletion should be performed. 103 * a dialog to confirm that the deletion should be performed.
102 */ 104 */
103 deleteSelectedWithPrompt: function() { 105 deleteSelectedWithPrompt: function() {
104 if (!loadTimeData.getBoolean('allowDeletingHistory')) 106 if (!loadTimeData.getBoolean('allowDeletingHistory'))
105 return; 107 return;
106 this.$.dialog.get().then(function(dialog) { 108 this.$.dialog.get().then(function(dialog) {
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 }, 209 },
208 210
209 /** 211 /**
210 * @return {HTMLElement} 212 * @return {HTMLElement}
211 * @private 213 * @private
212 */ 214 */
213 getSelectedList_: function() { 215 getSelectedList_: function() {
214 return this.$.content.selectedItem; 216 return this.$.content.selectedItem;
215 }, 217 },
216 }); 218 });
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698