OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 cr.define('extensions', function() { | 5 cr.define('extensions', function() { |
6 /** | 6 /** |
7 * @param {!Element} root | 7 * @param {!Element} root |
8 * @param {?Element} boundary | 8 * @param {?Element} boundary |
9 * @constructor | 9 * @constructor |
10 * @extends {cr.ui.FocusRow} | 10 * @extends {cr.ui.FocusRow} |
11 */ | 11 */ |
12 function FocusRow(root, boundary) { | 12 function FocusRow(root, boundary) { |
13 cr.ui.FocusRow.call(this, root, boundary); | 13 cr.ui.FocusRow.call(this, root, boundary); |
14 } | 14 } |
15 | 15 |
16 FocusRow.prototype = { | 16 FocusRow.prototype = { |
17 __proto__: cr.ui.FocusRow.prototype, | 17 __proto__: cr.ui.FocusRow.prototype, |
18 | 18 |
19 /** @override */ | 19 /** @override */ |
20 makeActive: function(active) { | 20 makeActive: function(active) { |
21 cr.ui.FocusRow.prototype.makeActive.call(this, active); | 21 cr.ui.FocusRow.prototype.makeActive.call(this, active); |
22 | 22 |
23 // Only highlight if the row has focus. | 23 // Only highlight if the row has focus. |
24 this.root.classList.toggle('extension-highlight', | 24 this.root.classList.toggle( |
| 25 'extension-highlight', |
25 active && this.root.contains(document.activeElement)); | 26 active && this.root.contains(document.activeElement)); |
26 }, | 27 }, |
27 }; | 28 }; |
28 | 29 |
29 return {FocusRow: FocusRow}; | 30 return {FocusRow: FocusRow}; |
30 }); | 31 }); |
OLD | NEW |