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

Unified Diff: chrome/browser/extensions/extension_tab_util.cc

Issue 518653002: Add the "options_ui" extension manifest field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build issue? Created 6 years, 3 months 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 side-by-side diff with in-line comments
Download patch
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 a5602ac1e8e43635a713db3c05f95697e1ef6357..1f8765ac21cedff3d518ea252387ff6967feef07 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -22,7 +22,6 @@
#include "chrome/browser/ui/tab_contents/tab_contents_iterator.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/extensions/api/tabs.h"
-#include "chrome/common/extensions/manifest_url_handler.h"
#include "chrome/common/url_constants.h"
#include "components/url_fixer/url_fixer.h"
#include "content/public/browser/favicon_status.h"
@@ -36,6 +35,7 @@
#include "extensions/common/feature_switch.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/incognito_info.h"
+#include "extensions/common/manifest_handlers/options_page_info.h"
#include "extensions/common/permissions/api_permission.h"
#include "extensions/common/permissions/permissions_data.h"
#include "url/gurl.h"
@@ -557,7 +557,7 @@ WindowController* ExtensionTabUtil::GetWindowControllerOfTab(
void ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
Browser* browser) {
- DCHECK(!ManifestURL::GetOptionsPage(extension).is_empty());
+ DCHECK(OptionsPageInfo::HasOptionsPage(extension));
// Force the options page to open in non-OTR window, because it won't be
// able to save settings from OTR.
@@ -569,9 +569,10 @@ void ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
browser = displayer->browser();
}
- if (FeatureSwitch::embedded_extension_options()->IsEnabled()) {
- // If embedded extension options are enabled, open chrome://extensions
- // in a new tab and show the extension options in an embedded popup.
+ if (!OptionsPageInfo::ShouldOpenInTab(extension)) {
+ // If we should embed the options page for this extension, open
+ // chrome://extensions in a new tab and show the extension options in an
+ // embedded popup.
chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams(
browser, GURL(chrome::kChromeUIExtensionsURL)));
params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE;
@@ -585,7 +586,7 @@ void ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
chrome::ShowSingletonTabOverwritingNTP(browser, params);
} else {
// Otherwise open a new tab with the extension's options page
- content::OpenURLParams params(ManifestURL::GetOptionsPage(extension),
+ content::OpenURLParams params(OptionsPageInfo::GetOptionsPage(extension),
content::Referrer(),
SINGLETON_TAB,
content::PAGE_TRANSITION_LINK,

Powered by Google App Engine
This is Rietveld 408576698