Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: chrome/browser/resources/extensions/focus_row.js

Issue 2939273002: DO NOT SUBMIT: what chrome/browser/resources/ could eventually look like with clang-format (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698