Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / third_party / polymer / v1_0 / components / iron-menu-behavior / iron-menubar-behavior.html
blobe25304a5ec329cd3b0f1e8ab259676028d36b215
1 <!--
2 @license
3 Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
5 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
6 The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
7 Code distributed by Google as part of the polymer project is also
8 subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
9 -->
11 <link rel="import" href="../polymer/polymer.html">
12 <link rel="import" href="iron-menu-behavior.html">
14 <script>
16 /**
17 * `Polymer.IronMenubarBehavior` implements accessible menubar behavior.
19 * @polymerBehavior Polymer.IronMenubarBehavior
21 Polymer.IronMenubarBehaviorImpl = {
23 hostAttributes: {
24 'role': 'menubar'
27 keyBindings: {
28 'left': '_onLeftKey',
29 'right': '_onRightKey'
32 _onUpKey: function(event) {
33 this._activateFocused(event.detail.keyboardEvent);
36 _onDownKey: function(event) {
37 this._activateFocused(event.detail.keyboardEvent);
40 _onLeftKey: function() {
41 this._focusPrevious();
44 _onRightKey: function() {
45 this._focusNext();
48 _onKeydown: function(event) {
49 if (this.keyboardEventMatchesKeys(event, 'up down left right esc enter')) {
50 return;
53 // all other keys focus the menu item starting with that character
54 this._focusWithKeyboardEvent(event);
59 /** @polymerBehavior Polymer.IronMenubarBehavior */
60 Polymer.IronMenubarBehavior = [
61 Polymer.IronMenuBehavior,
62 Polymer.IronMenubarBehaviorImpl
65 </script>