Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <include src="../uber/uber_utils.js"> | 5 <include src="../uber/uber_utils.js"> |
| 6 <include src="history_focus_manager.js"> | 6 <include src="history_focus_manager.js"> |
| 7 | 7 |
| 8 /////////////////////////////////////////////////////////////////////////////// | 8 /////////////////////////////////////////////////////////////////////////////// |
| 9 // Globals: | 9 // Globals: |
| 10 /** @const */ var RESULTS_PER_PAGE = 150; | 10 /** @const */ var RESULTS_PER_PAGE = 150; |
| (...skipping 2162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2173 var element = event.target; | 2173 var element = event.target; |
| 2174 // Do nothing if the event happened in an interactive element. | 2174 // Do nothing if the event happened in an interactive element. |
| 2175 for (; element != event.currentTarget; element = element.parentNode) { | 2175 for (; element != event.currentTarget; element = element.parentNode) { |
| 2176 switch (element.tagName) { | 2176 switch (element.tagName) { |
| 2177 case 'A': | 2177 case 'A': |
| 2178 case 'BUTTON': | 2178 case 'BUTTON': |
| 2179 case 'INPUT': | 2179 case 'INPUT': |
| 2180 return; | 2180 return; |
| 2181 } | 2181 } |
| 2182 } | 2182 } |
| 2183 var checkbox = $(event.currentTarget.getAttribute('for')); | 2183 var checkbox = /** @type {!HTMLInputElement} */( |
|
Dan Beam
2014/09/05 21:28:46
why not assertInstanceOf?
Vitaly Pavlenko
2014/09/05 23:42:13
Done.
| |
| 2184 $(event.currentTarget.getAttribute('for'))); | |
| 2184 checkbox.checked = !checkbox.checked; | 2185 checkbox.checked = !checkbox.checked; |
| 2185 handleCheckboxStateChange(checkbox, event.shiftKey); | 2186 handleCheckboxStateChange(checkbox, event.shiftKey); |
| 2186 // We don't want to focus on the checkbox. | 2187 // We don't want to focus on the checkbox. |
| 2187 event.preventDefault(); | 2188 event.preventDefault(); |
| 2188 } | 2189 } |
| 2189 | 2190 |
| 2190 /** | 2191 /** |
| 2191 * Called when an individual history entry has been removed from the page. | 2192 * Called when an individual history entry has been removed from the page. |
| 2192 * This will only be called when all the elements affected by the deletion | 2193 * This will only be called when all the elements affected by the deletion |
| 2193 * have been removed from the DOM and the animations have completed. | 2194 * have been removed from the DOM and the animations have completed. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2273 historyView.reload(); | 2274 historyView.reload(); |
| 2274 } | 2275 } |
| 2275 | 2276 |
| 2276 // Add handlers to HTML elements. | 2277 // Add handlers to HTML elements. |
| 2277 document.addEventListener('DOMContentLoaded', load); | 2278 document.addEventListener('DOMContentLoaded', load); |
| 2278 | 2279 |
| 2279 // This event lets us enable and disable menu items before the menu is shown. | 2280 // This event lets us enable and disable menu items before the menu is shown. |
| 2280 document.addEventListener('canExecute', function(e) { | 2281 document.addEventListener('canExecute', function(e) { |
| 2281 e.canExecute = true; | 2282 e.canExecute = true; |
| 2282 }); | 2283 }); |
| OLD | NEW |