| Index: chrome/browser/extensions/extension_tab_util.cc
|
| diff --git a/chrome/browser/extensions/extension_tab_util.cc b/chrome/browser/extensions/extension_tab_util.cc
|
| index a268df55687fd7f34d21bd8ebffca2ffe8c8008d..91ca5041898ff9ed0ef7eaf0c573913fde72cb86 100644
|
| --- a/chrome/browser/extensions/extension_tab_util.cc
|
| +++ b/chrome/browser/extensions/extension_tab_util.cc
|
| @@ -635,7 +635,8 @@ bool ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
|
| }
|
|
|
| GURL url_to_navigate;
|
| - if (OptionsPageInfo::ShouldOpenInTab(extension)) {
|
| + bool open_in_tab = OptionsPageInfo::ShouldOpenInTab(extension);
|
| + if (open_in_tab) {
|
| // Options page tab is simply e.g. chrome-extension://.../options.html.
|
| url_to_navigate = OptionsPageInfo::GetOptionsPage(extension);
|
| } else {
|
| @@ -653,8 +654,12 @@ bool ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
|
| chrome::GetSingletonTabNavigateParams(browser, url_to_navigate));
|
| // We need to respect path differences because we don't want opening the
|
| // options page to close a page that might be open to extension content.
|
| + // However, if the options page opens inside the chrome://extensions page, we
|
| + // can override an existing page.
|
| // Note: default ref behavior is IGNORE_REF, which is correct.
|
| - params.path_behavior = chrome::NavigateParams::RESPECT;
|
| + params.path_behavior = open_in_tab
|
| + ? chrome::NavigateParams::RESPECT
|
| + : chrome::NavigateParams::IGNORE_AND_NAVIGATE;
|
| params.url = url_to_navigate;
|
| chrome::ShowSingletonTabOverwritingNTP(browser, params);
|
| return true;
|
|
|