Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

Side by Side Diff: chrome/browser/resources/options/browser_options.js

Issue 732253002: options: Fix focus "Show advanced settings..." click focus regression. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix-settings-focus
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | ui/webui/resources/js/cr/ui/focus_outline_manager.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | ui/webui/resources/js/cr/ui/focus_outline_manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698