Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 /** | 5 /** |
| 6 * @fileoverview The section of the history page that shows tabs from sessions | 6 * @fileoverview The section of the history page that shows tabs from sessions |
| 7 on other devices. | 7 on other devices. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 /////////////////////////////////////////////////////////////////////////////// | 10 /////////////////////////////////////////////////////////////////////////////// |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 | 178 |
| 179 // Keep track of the drop down that triggered the menu, so we know | 179 // Keep track of the drop down that triggered the menu, so we know |
| 180 // which element to apply the command to. | 180 // which element to apply the command to. |
| 181 var session = this.session_; | 181 var session = this.session_; |
| 182 function handleDropDownFocus(e) { | 182 function handleDropDownFocus(e) { |
| 183 DeviceContextMenuController.getInstance().setSession(session); | 183 DeviceContextMenuController.getInstance().setSession(session); |
| 184 } | 184 } |
| 185 heading.addEventListener('contextmenu', handleDropDownFocus); | 185 heading.addEventListener('contextmenu', handleDropDownFocus); |
| 186 | 186 |
| 187 var dropDownButton = new cr.ui.ContextMenuButton; | 187 var dropDownButton = new cr.ui.ContextMenuButton; |
| 188 dropDownButton.tabIndex = 0; | |
|
dmazzoni
2014/10/10 05:31:18
Should this be upstreamed to cr.ui.ContextMenuButt
| |
| 188 dropDownButton.classList.add('drop-down'); | 189 dropDownButton.classList.add('drop-down'); |
| 189 dropDownButton.addEventListener('mousedown', function(event) { | 190 dropDownButton.addEventListener('mousedown', function(event) { |
| 190 handleDropDownFocus(event); | 191 handleDropDownFocus(event); |
| 191 // Mousedown handling of cr.ui.MenuButton.handleEvent calls | 192 // Mousedown handling of cr.ui.MenuButton.handleEvent calls |
| 192 // preventDefault, which prevents blur of the focused element. We need to | 193 // preventDefault, which prevents blur of the focused element. We need to |
| 193 // do blur manually. | 194 // do blur manually. |
| 194 document.activeElement.blur(); | 195 document.activeElement.blur(); |
| 195 }); | 196 }); |
| 196 dropDownButton.addEventListener('focus', handleDropDownFocus); | 197 dropDownButton.addEventListener('focus', handleDropDownFocus); |
| 197 heading.appendChild(dropDownButton); | 198 heading.appendChild(dropDownButton); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 530 | 531 |
| 531 var doSearch = function(e) { | 532 var doSearch = function(e) { |
| 532 devicesView.setSearchText($('search-field').value); | 533 devicesView.setSearchText($('search-field').value); |
| 533 }; | 534 }; |
| 534 $('search-field').addEventListener('search', doSearch); | 535 $('search-field').addEventListener('search', doSearch); |
| 535 $('search-button').addEventListener('click', doSearch); | 536 $('search-button').addEventListener('click', doSearch); |
| 536 } | 537 } |
| 537 | 538 |
| 538 // Add handlers to HTML elements. | 539 // Add handlers to HTML elements. |
| 539 document.addEventListener('DOMContentLoaded', load); | 540 document.addEventListener('DOMContentLoaded', load); |
| OLD | NEW |