| 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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 var removeButton = createElementWithClassName('button', 'remove-entry'); | 280 var removeButton = createElementWithClassName('button', 'remove-entry'); |
| 281 removeButton.setAttribute('aria-label', | 281 removeButton.setAttribute('aria-label', |
| 282 loadTimeData.getString('removeFromHistory')); | 282 loadTimeData.getString('removeFromHistory')); |
| 283 removeButton.classList.add('custom-appearance'); | 283 removeButton.classList.add('custom-appearance'); |
| 284 removeButton.addEventListener( | 284 removeButton.addEventListener( |
| 285 'click', this.removeEntryFromHistory_.bind(this)); | 285 'click', this.removeEntryFromHistory_.bind(this)); |
| 286 entryBox.appendChild(removeButton); | 286 entryBox.appendChild(removeButton); |
| 287 | 287 |
| 288 // Support clicking anywhere inside the entry box. | 288 // Support clicking anywhere inside the entry box. |
| 289 entryBox.addEventListener('click', function(e) { | 289 entryBox.addEventListener('click', function(e) { |
| 290 if (!e.defaultPrevented) | 290 if (!e.defaultPrevented) { |
| 291 self.titleLink.focus(); |
| 291 self.titleLink.click(); | 292 self.titleLink.click(); |
| 293 } |
| 292 }); | 294 }); |
| 293 } else { | 295 } else { |
| 294 var dropDown = createElementWithClassName('button', 'drop-down'); | 296 var dropDown = createElementWithClassName('button', 'drop-down'); |
| 295 dropDown.value = 'Open action menu'; | 297 dropDown.value = 'Open action menu'; |
| 296 dropDown.title = loadTimeData.getString('actionMenuDescription'); | 298 dropDown.title = loadTimeData.getString('actionMenuDescription'); |
| 297 dropDown.setAttribute('menu', '#action-menu'); | 299 dropDown.setAttribute('menu', '#action-menu'); |
| 298 dropDown.setAttribute('aria-haspopup', 'true'); | 300 dropDown.setAttribute('aria-haspopup', 'true'); |
| 299 | 301 |
| 300 if (focusless) | 302 if (focusless) |
| 301 dropDown.tabIndex = -1; | 303 dropDown.tabIndex = -1; |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2395 historyView.reload(); | 2397 historyView.reload(); |
| 2396 } | 2398 } |
| 2397 | 2399 |
| 2398 // Add handlers to HTML elements. | 2400 // Add handlers to HTML elements. |
| 2399 document.addEventListener('DOMContentLoaded', load); | 2401 document.addEventListener('DOMContentLoaded', load); |
| 2400 | 2402 |
| 2401 // This event lets us enable and disable menu items before the menu is shown. | 2403 // This event lets us enable and disable menu items before the menu is shown. |
| 2402 document.addEventListener('canExecute', function(e) { | 2404 document.addEventListener('canExecute', function(e) { |
| 2403 e.canExecute = true; | 2405 e.canExecute = true; |
| 2404 }); | 2406 }); |
| OLD | NEW |