Skip to content

Commit

Permalink
Add command line flags for embedded extension options
Browse files Browse the repository at this point in the history
This CL adds flags to allow extension options to be embedded inside
chrome://extensions.

BUG=386842

Review URL: https://codereview.chromium.org/370353002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281622 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ericzeng@chromium.org committed Jul 8, 2014
1 parent 7ed8659 commit 409d920
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 1 deletion.
6 changes: 6 additions & 0 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -6545,6 +6545,12 @@ Keep your key file in a safe place. You will need it to create new versions of y
If enabled, responses to certain types of queries will appear directly in the Omnibox suggestion list.
</message>
</if>
<message name="IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME" desc="Name of the flag that enables embedding extension options in chrome://extensions.">
Enable embedded extension options.
</message>
<message name="IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION" desc="Description of the flag that enables embedding extension options in chrome://extensions.">
Display extension options as an embedded element in chrome://extensions rather than opening a new tab.
</message>

<!-- Crashes -->
<message name="IDS_CRASHES_TITLE" desc="Title for the chrome://crashes page.">
Expand Down
7 changes: 7 additions & 0 deletions chrome/browser/about_flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1961,6 +1961,13 @@ const Experiment kExperiments[] = {
SINGLE_VALUE_TYPE(chromeos::switches::kEnableOkGoogleVoiceSearch)
},
#endif
{
"enable-embedded-extension-options",
IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_NAME,
IDS_FLAGS_ENABLE_EMBEDDED_EXTENSION_OPTIONS_DESCRIPTION,
kOsDesktop,
SINGLE_VALUE_TYPE(extensions::switches::kEnableEmbeddedExtensionOptions)
},
};

const Experiment* experiments = kExperiments;
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/chrome_content_browser_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
autofill::switches::kLocalHeuristicsOnlyForPasswordGeneration,
extensions::switches::kAllowHTTPBackgroundPage,
extensions::switches::kAllowLegacyExtensionManifests,
extensions::switches::kEnableEmbeddedExtensionOptions,
extensions::switches::kEnableExperimentalExtensionApis,
extensions::switches::kEnableScriptsRequireAction,
extensions::switches::kExtensionsOnChromeURLs,
Expand Down
9 changes: 8 additions & 1 deletion extensions/common/feature_switch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ class CommonSwitches {
switches::kExtensionActionRedesign,
FeatureSwitch::DEFAULT_DISABLED),
scripts_require_action(switches::kScriptsRequireAction,
FeatureSwitch::DEFAULT_DISABLED) {}
FeatureSwitch::DEFAULT_DISABLED),
embedded_extension_options(
switches::kEmbeddedExtensionOptions,
FeatureSwitch::DEFAULT_DISABLED) {}

// Enables extensions to be easily installed from sites other than the web
// store.
Expand All @@ -64,6 +67,7 @@ class CommonSwitches {
FeatureSwitch enable_override_bookmarks_ui;
FeatureSwitch extension_action_redesign;
FeatureSwitch scripts_require_action;
FeatureSwitch embedded_extension_options;
};

base::LazyInstance<CommonSwitches> g_common_switches =
Expand Down Expand Up @@ -95,6 +99,9 @@ FeatureSwitch* FeatureSwitch::extension_action_redesign() {
FeatureSwitch* FeatureSwitch::scripts_require_action() {
return &g_common_switches.Get().scripts_require_action;
}
FeatureSwitch* FeatureSwitch::embedded_extension_options() {
return &g_common_switches.Get().embedded_extension_options;
}

FeatureSwitch::ScopedOverride::ScopedOverride(FeatureSwitch* feature,
bool override_value)
Expand Down
1 change: 1 addition & 0 deletions extensions/common/feature_switch.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class FeatureSwitch {
static FeatureSwitch* enable_override_bookmarks_ui();
static FeatureSwitch* extension_action_redesign();
static FeatureSwitch* scripts_require_action();
static FeatureSwitch* embedded_extension_options();

enum DefaultValue {
DEFAULT_ENABLED,
Expand Down
9 changes: 9 additions & 0 deletions extensions/common/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ const char kAllowHTTPBackgroundPage[] = "allow-http-background-page";
const char kAllowLegacyExtensionManifests[] =
"allow-legacy-extension-manifests";

// Enables extension options to be embedded in chrome://extensions rather than
// a new tab.
const char kEmbeddedExtensionOptions[] = "embedded-extension-options";

// Hack so that feature switch can work with about_flags. See
// kEnableScriptsRequireAction.
const char kEnableEmbeddedExtensionOptions[] =
"enable-embedded-extension-options";

// Enables extension APIs that are in development.
const char kEnableExperimentalExtensionApis[] =
"enable-experimental-extension-apis";
Expand Down
2 changes: 2 additions & 0 deletions extensions/common/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ namespace switches {

extern const char kAllowHTTPBackgroundPage[];
extern const char kAllowLegacyExtensionManifests[];
extern const char kEmbeddedExtensionOptions[];
extern const char kEnableEmbeddedExtensionOptions[];
extern const char kEnableExperimentalExtensionApis[];
extern const char kEnableOverrideBookmarksUI[];
extern const char kErrorConsole[];
Expand Down

0 comments on commit 409d920

Please sign in to comment.