| 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.exportPath('options'); | 5 cr.exportPath('options'); |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * @typedef {{actionLinkText: (string|undefined), | 8 * @typedef {{actionLinkText: (string|undefined), |
| 9 * hasError: (boolean|undefined), | 9 * hasError: (boolean|undefined), |
| 10 * hasUnrecoverableError: (boolean|undefined), | 10 * hasUnrecoverableError: (boolean|undefined), |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 var showAdvanced = | 120 var showAdvanced = |
| 121 BrowserOptions.shouldShowSection_($('advanced-settings')); | 121 BrowserOptions.shouldShowSection_($('advanced-settings')); |
| 122 if (showAdvanced) { | 122 if (showAdvanced) { |
| 123 chrome.send('coreOptionsUserMetricsAction', | 123 chrome.send('coreOptionsUserMetricsAction', |
| 124 ['Options_ShowAdvancedSettings']); | 124 ['Options_ShowAdvancedSettings']); |
| 125 } | 125 } |
| 126 self.toggleSectionWithAnimation_( | 126 self.toggleSectionWithAnimation_( |
| 127 $('advanced-settings'), | 127 $('advanced-settings'), |
| 128 $('advanced-settings-container')); | 128 $('advanced-settings-container')); |
| 129 | 129 |
| 130 // If the link was focused (i.e., it was activated using the keyboard) | 130 // If the click was triggered using the keyboard and it showed the |
| 131 // and it was used to show the section (rather than hiding it), focus | 131 // section (rather than hiding it), focus the first element in the |
| 132 // the first element in the container. | 132 // container. |
| 133 if (document.activeElement === $('advanced-settings-expander') && | 133 var manager = cr.ui.FocusOutlineManager.forDocument(document); |
| 134 showAdvanced) { | 134 if (manager.visible && showAdvanced) { |
| 135 var focusElement = $('advanced-settings-container').querySelector( | 135 var focusElement = $('advanced-settings-container').querySelector( |
| 136 'button, input, list, select, a[href]'); | 136 'button, input, list, select, a[href]'); |
| 137 if (focusElement) | 137 if (focusElement) |
| 138 focusElement.focus(); | 138 focusElement.focus(); |
| 139 } | 139 } |
| 140 }; | 140 }; |
| 141 } else { | 141 } else { |
| 142 $('advanced-settings-expander').hidden = true; | 142 $('advanced-settings-expander').hidden = true; |
| 143 $('advanced-settings').hidden = true; | 143 $('advanced-settings').hidden = true; |
| 144 } | 144 } |
| (...skipping 2029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2174 } | 2174 } |
| 2175 button.textContent = loadTimeData.getString(strId); | 2175 button.textContent = loadTimeData.getString(strId); |
| 2176 }; | 2176 }; |
| 2177 } | 2177 } |
| 2178 | 2178 |
| 2179 // Export | 2179 // Export |
| 2180 return { | 2180 return { |
| 2181 BrowserOptions: BrowserOptions | 2181 BrowserOptions: BrowserOptions |
| 2182 }; | 2182 }; |
| 2183 }); | 2183 }); |
| OLD | NEW |