OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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('options', function() { | 5 cr.define('options', function() { |
6 /** @const */ var FocusOutlineManager = cr.ui.FocusOutlineManager; | 6 /** @const */ var FocusOutlineManager = cr.ui.FocusOutlineManager; |
7 | 7 |
8 ///////////////////////////////////////////////////////////////////////////// | 8 ///////////////////////////////////////////////////////////////////////////// |
9 // OptionsPage class: | 9 // OptionsPage class: |
10 | 10 |
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 } | 276 } |
277 | 277 |
278 // Update tab title. | 278 // Update tab title. |
279 this.setTitle_(overlay.title); | 279 this.setTitle_(overlay.title); |
280 | 280 |
281 // Change focus to the overlay if any other control was focused by keyboard | 281 // Change focus to the overlay if any other control was focused by keyboard |
282 // before. Otherwise, no one should have focus. | 282 // before. Otherwise, no one should have focus. |
283 if (document.activeElement != document.body) { | 283 if (document.activeElement != document.body) { |
284 if (FocusOutlineManager.forDocument(document).visible) { | 284 if (FocusOutlineManager.forDocument(document).visible) { |
285 overlay.focus(); | 285 overlay.focus(); |
286 } else { | 286 } else if (!overlay.pageDiv.contains(document.activeElement)) { |
287 document.activeElement.blur(); | 287 document.activeElement.blur(); |
288 } | 288 } |
289 } | 289 } |
290 | 290 |
291 $('searchBox').setAttribute('aria-hidden', true); | 291 $('searchBox').setAttribute('aria-hidden', true); |
292 | 292 |
293 if ($('search-field').value == '') { | 293 if ($('search-field').value == '') { |
294 var section = overlay.associatedSection; | 294 var section = overlay.associatedSection; |
295 if (section) | 295 if (section) |
296 options.BrowserOptions.scrollToSection(section); | 296 options.BrowserOptions.scrollToSection(section); |
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 canShowPage: function() { | 982 canShowPage: function() { |
983 return true; | 983 return true; |
984 }, | 984 }, |
985 }; | 985 }; |
986 | 986 |
987 // Export | 987 // Export |
988 return { | 988 return { |
989 OptionsPage: OptionsPage | 989 OptionsPage: OptionsPage |
990 }; | 990 }; |
991 }); | 991 }); |
OLD | NEW |