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 // TODO(jhawkins): Use hidden instead of showInline* and display:none. | 5 // TODO(jhawkins): Use hidden instead of showInline* and display:none. |
6 // TODO(hcarmona): This file is big: it may be good to split it up. | 6 // TODO(hcarmona): This file is big: it may be good to split it up. |
7 | 7 |
8 /** | 8 /** |
9 * The type of the download object. The definition is based on | 9 * The type of the download object. The definition is based on |
10 * chrome/browser/ui/webui/downloads_dom_handler.cc:CreateDownloadItemValue() | 10 * chrome/browser/ui/webui/downloads_dom_handler.cc:CreateDownloadItemValue() |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 */ | 149 */ |
150 addElementIfFocusable_: function(element, type) { | 150 addElementIfFocusable_: function(element, type) { |
151 if (this.shouldFocus_(element)) { | 151 if (this.shouldFocus_(element)) { |
152 this.addFocusableElement(element); | 152 this.addFocusableElement(element); |
153 element.setAttribute('column-type', type); | 153 element.setAttribute('column-type', type); |
154 } | 154 } |
155 }, | 155 }, |
156 | 156 |
157 /** | 157 /** |
158 * Determines if element should be focusable. | 158 * Determines if element should be focusable. |
159 * @param {!Element} element | 159 * @param {Element} element |
160 * @return {boolean} | 160 * @return {boolean} |
161 * @private | 161 * @private |
162 */ | 162 */ |
163 shouldFocus_: function(element) { | 163 shouldFocus_: function(element) { |
164 if (!element) | 164 if (!element) |
165 return false; | 165 return false; |
166 | 166 |
167 // Hidden elements are not focusable. | 167 // Hidden elements are not focusable. |
168 var style = window.getComputedStyle(element); | 168 var style = window.getComputedStyle(element); |
169 if (style.visibility == 'hidden' || style.display == 'none') | 169 if (style.visibility == 'hidden' || style.display == 'none') |
(...skipping 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 if (Date.now() - start > 50) { | 1100 if (Date.now() - start > 50) { |
1101 clearTimeout(resultsTimeout); | 1101 clearTimeout(resultsTimeout); |
1102 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); | 1102 resultsTimeout = setTimeout(tryDownloadUpdatedPeriodically, 5); |
1103 break; | 1103 break; |
1104 } | 1104 } |
1105 } | 1105 } |
1106 } | 1106 } |
1107 | 1107 |
1108 // Add handlers to HTML elements. | 1108 // Add handlers to HTML elements. |
1109 window.addEventListener('DOMContentLoaded', load); | 1109 window.addEventListener('DOMContentLoaded', load); |
OLD | NEW |