OLD | NEW |
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 */ | 129 */ |
130 deleteSelectedWithPrompt: function() { | 130 deleteSelectedWithPrompt: function() { |
131 if (!loadTimeData.getBoolean('allowDeletingHistory')) | 131 if (!loadTimeData.getBoolean('allowDeletingHistory')) |
132 return; | 132 return; |
133 | 133 |
134 var browserService = md_history.BrowserService.getInstance(); | 134 var browserService = md_history.BrowserService.getInstance(); |
135 browserService.recordAction('RemoveSelected'); | 135 browserService.recordAction('RemoveSelected'); |
136 if (this.queryState.searchTerm != '') | 136 if (this.queryState.searchTerm != '') |
137 browserService.recordAction('SearchResultRemove'); | 137 browserService.recordAction('SearchResultRemove'); |
138 this.$.dialog.get().showModal(); | 138 this.$.dialog.get().showModal(); |
| 139 |
| 140 // TODO(dbeam): remove focus flicker caused by showModal() + focus(). |
| 141 this.$$('.action-button').focus(); |
139 }, | 142 }, |
140 | 143 |
141 /** | 144 /** |
142 * @param {HistoryRange} range | 145 * @param {HistoryRange} range |
143 * @private | 146 * @private |
144 */ | 147 */ |
145 groupedRangeChanged_: function(range, oldRange) { | 148 groupedRangeChanged_: function(range, oldRange) { |
146 this.selectedPage_ = range == HistoryRange.ALL_TIME ? | 149 this.selectedPage_ = range == HistoryRange.ALL_TIME ? |
147 'infinite-list' : 'grouped-list'; | 150 'infinite-list' : 'grouped-list'; |
148 | 151 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 }.bind(this)); | 273 }.bind(this)); |
271 menu.closeMenu(); | 274 menu.closeMenu(); |
272 }, | 275 }, |
273 | 276 |
274 /** | 277 /** |
275 * @return {HTMLElement} | 278 * @return {HTMLElement} |
276 * @private | 279 * @private |
277 */ | 280 */ |
278 getSelectedList_: function() { return this.$.content.selectedItem; }, | 281 getSelectedList_: function() { return this.$.content.selectedItem; }, |
279 }); | 282 }); |
OLD | NEW |