Make UI or API driven extension options navigations refocus any existing options page.
This is already the way that the options pages embedded in chrome://extensions
work. Options pages not embedded (those declared via "options_page" or with
{"open_in_tab": true} in "options_ui") currently always open in a new tab - now
it will refocus instead.
This will affect any caller of ExtensionTabUtil::OpenOptionsPage - called from
UI like the toolbar button's context menu, and from the
chrome.browser.openOptionsPage API call.
An important side-effect of all of this is that the old behavior is buggy when
a devtools window is focused (see crash report), and this fixes it. This was
impossible to trigger until we added the chrome.browser.openOptionsPage() - now
quite likely that a devtools window is focused.
BUG=430054, 463341
R=rockot@chromium.org
Review URL: https://codereview.chromium.org/1005673002
Cr-Commit-Position: refs/heads/master@{#320426}
3 files changed