Index: ui/file_manager/file_manager/foreground/elements/files_icon_button.js |
diff --git a/ui/file_manager/file_manager/foreground/elements/files_icon_button.js b/ui/file_manager/file_manager/foreground/elements/files_icon_button.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..63039f3c6971b300f894724c354d789fbcff2ae5 |
--- /dev/null |
+++ b/ui/file_manager/file_manager/foreground/elements/files_icon_button.js |
@@ -0,0 +1,29 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+Polymer({ |
+ is: 'files-icon-button', |
+ |
+ hostAttributes: { |
+ role: 'button', |
+ tabindex: 0 |
+ }, |
+ |
+ behaviors: [ |
+ Polymer.IronButtonState, |
+ Polymer.IronControlState |
+ ], |
+ |
+ observers: [ |
+ '_focusedChanged(receivedFocusFromKeyboard)' |
+ ], |
+ |
+ _focusedChanged: function(receivedFocusFromKeyboard) { |
+ if (receivedFocusFromKeyboard) { |
+ this.classList.add('keyboard-focus'); |
+ } else { |
+ this.classList.remove('keyboard-focus'); |
+ } |
+ } |
+}); |