summaryrefslogtreecommitdiffstats
path: root/extensions/common/manifest_handlers
diff options
context:
space:
mode:
authorkalman <kalman@chromium.org>2014-10-17 17:50:04 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-18 00:50:25 +0000
commit9807701d4c6789b9df38a9a33ca28ca4de2861c5 (patch)
tree469ea825cfca69b94c717e26bcc5a4ad0f9cf889 /extensions/common/manifest_handlers
parentea319e730a0002e972853c996ec41c454a90e3aa (diff)
downloadchromium_src-9807701d4c6789b9df38a9a33ca28ca4de2861c5.zip
chromium_src-9807701d4c6789b9df38a9a33ca28ca4de2861c5.tar.gz
chromium_src-9807701d4c6789b9df38a9a33ca28ca4de2861c5.tar.bz2
First stage of launch for embedded options pages. With this patch, extensions
are allowed to opt-in to having embedded options pages and/or chrome style. The flag --enable-embedded-extension-options makes the default for embedding options pages true unless extensions opt-out. This is still useful for development. BUG=414920 R=rockot@chromium.org Review URL: https://codereview.chromium.org/667453003 Cr-Commit-Position: refs/heads/master@{#300190}
Diffstat (limited to 'extensions/common/manifest_handlers')
-rw-r--r--extensions/common/manifest_handlers/options_page_info.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/extensions/common/manifest_handlers/options_page_info.cc b/extensions/common/manifest_handlers/options_page_info.cc
index e669f0c..efcff83 100644
--- a/extensions/common/manifest_handlers/options_page_info.cc
+++ b/extensions/common/manifest_handlers/options_page_info.cc
@@ -111,12 +111,14 @@ scoped_ptr<OptionsPageInfo> OptionsPageInfo::Create(
std::vector<InstallWarning>* install_warnings,
base::string16* error) {
GURL options_page;
+ // Chrome styling is always opt-in.
bool chrome_style = false;
+ // Extensions can opt in or out to opening in a tab, and users can choose via
+ // the --embedded-extension-options flag which should be the default.
bool open_in_tab = !FeatureSwitch::embedded_extension_options()->IsEnabled();
// Parse the options_ui object.
- if (options_ui_value &&
- FeatureSwitch::embedded_extension_options()->IsEnabled()) {
+ if (options_ui_value) {
base::string16 options_ui_error;
scoped_ptr<OptionsUI> options_ui =
@@ -140,9 +142,10 @@ scoped_ptr<OptionsPageInfo> OptionsPageInfo::Create(
install_warnings->push_back(
InstallWarning(base::UTF16ToASCII(options_parse_error)));
}
- chrome_style =
- options_ui->chrome_style.get() && *options_ui->chrome_style;
- open_in_tab = options_ui->open_in_tab.get() && *options_ui->open_in_tab;
+ if (options_ui->chrome_style.get())
+ chrome_style = *options_ui->chrome_style;
+ if (options_ui->open_in_tab.get())
+ open_in_tab = *options_ui->open_in_tab;
}
}