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

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

Issue 484033003: Open embedded extension options from the extension action context menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move tab opening code from chrome_pages to ExtensionTabUtil Created 6 years, 4 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 75991084362ed7a7bf035ce92d800d3c9c5b584b..0b6abfc46c5f0530c49c15b32fd6845900f623e6 100644
--- a/chrome/browser/extensions/extension_tab_util.cc
+++ b/chrome/browser/extensions/extension_tab_util.cc
@@ -31,6 +31,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension.h"
+#include "extensions/common/feature_switch.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/manifest_handlers/incognito_info.h"
#include "extensions/common/permissions/api_permission.h"
@@ -566,7 +567,21 @@ void ExtensionTabUtil::OpenOptionsPage(const Extension* extension,
browser = displayer->browser();
}
- content::OpenURLParams params(ManifestURL::GetOptionsPage(extension),
+ GURL options_url;
+ if (extensions::FeatureSwitch::embedded_extension_options()->IsEnabled()) {
Devlin 2014/08/19 22:20:41 Maybe a quick comment to say what the implications
Devlin 2014/08/19 22:20:41 no extensions::
ericzeng 2014/08/19 22:47:51 Done.
+ options_url = GURL(chrome::kChromeUIExtensionsURL);
+ if (!extension->id().empty()) {
+ GURL::Replacements replacements;
+ std::string query("options=");
+ query += extension->id();
Devlin 2014/08/19 22:20:41 use StringPrintf here: std::string query = base::S
ericzeng 2014/08/19 22:47:51 Done.
+ replacements.SetQueryStr(query);
+ options_url = options_url.ReplaceComponents(replacements);
+ }
+ } else {
+ options_url = ManifestURL::GetOptionsPage(extension);
+ }
+
+ content::OpenURLParams params(options_url,
content::Referrer(),
SINGLETON_TAB,
content::PAGE_TRANSITION_LINK,

Powered by Google App Engine
This is Rietveld 408576698