| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 /** | 5 /** |
| 6 * @fileoverview Assertion support. | 6 * @fileoverview Assertion support. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Verify |condition| is truthy and return |condition| if so. | 10 * Verify |condition| is truthy and return |condition| if so. |
| (...skipping 4123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4134 | 4134 |
| 4135 /** @this {ActionLink} */ | 4135 /** @this {ActionLink} */ |
| 4136 createdCallback: function() { | 4136 createdCallback: function() { |
| 4137 // Action links can start disabled (e.g. <a is="action-link" disabled>). | 4137 // Action links can start disabled (e.g. <a is="action-link" disabled>). |
| 4138 this.tabIndex = this.disabled ? -1 : 0; | 4138 this.tabIndex = this.disabled ? -1 : 0; |
| 4139 | 4139 |
| 4140 if (!this.hasAttribute('role')) | 4140 if (!this.hasAttribute('role')) |
| 4141 this.setAttribute('role', 'link'); | 4141 this.setAttribute('role', 'link'); |
| 4142 | 4142 |
| 4143 this.addEventListener('keydown', function(e) { | 4143 this.addEventListener('keydown', function(e) { |
| 4144 if (!this.disabled && e.keyIdentifier == 'Enter' && !this.href) { | 4144 if (!this.disabled && e.key == 'Enter' && !this.href) { |
| 4145 // Schedule a click asynchronously because other 'keydown' handlers | 4145 // Schedule a click asynchronously because other 'keydown' handlers |
| 4146 // may still run later (e.g. document.addEventListener('keydown')). | 4146 // may still run later (e.g. document.addEventListener('keydown')). |
| 4147 // Specifically options dialogs break when this timeout isn't here. | 4147 // Specifically options dialogs break when this timeout isn't here. |
| 4148 // NOTE: this affects the "trusted" state of the ensuing click. I | 4148 // NOTE: this affects the "trusted" state of the ensuing click. I |
| 4149 // haven't found anything that breaks because of this (yet). | 4149 // haven't found anything that breaks because of this (yet). |
| 4150 window.setTimeout(this.click.bind(this), 0); | 4150 window.setTimeout(this.click.bind(this), 0); |
| 4151 } | 4151 } |
| 4152 }); | 4152 }); |
| 4153 | 4153 |
| 4154 function preventDefault(e) { | 4154 function preventDefault(e) { |
| (...skipping 7333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11488 Manager.updateItem = function(index, data) { | 11488 Manager.updateItem = function(index, data) { |
| 11489 Manager.get().updateItem_(index, data); | 11489 Manager.get().updateItem_(index, data); |
| 11490 }; | 11490 }; |
| 11491 | 11491 |
| 11492 return {Manager: Manager}; | 11492 return {Manager: Manager}; |
| 11493 }); | 11493 }); |
| 11494 // Copyright 2015 The Chromium Authors. All rights reserved. | 11494 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 11495 // Use of this source code is governed by a BSD-style license that can be | 11495 // Use of this source code is governed by a BSD-style license that can be |
| 11496 // found in the LICENSE file. | 11496 // found in the LICENSE file. |
| 11497 | 11497 |
| 11498 window.addEventListener('load', downloads.Manager.onLoad); | 11498 window.addEventListener('load', downloads.Manager.onLoad); |
| OLD | NEW |