Chromium Code Reviews| Index: chrome/browser/component_updater/origin_trials_component_installer.cc |
| diff --git a/chrome/browser/component_updater/origin_trials_component_installer.cc b/chrome/browser/component_updater/origin_trials_component_installer.cc |
| index a32d62a3c4c6fd9e2429c1c01717a6ca488a476f..a76028fef948b1f370a32b23387b693a98b1e6ef 100644 |
| --- a/chrome/browser/component_updater/origin_trials_component_installer.cc |
| +++ b/chrome/browser/component_updater/origin_trials_component_installer.cc |
| @@ -8,6 +8,7 @@ |
| #include "base/command_line.h" |
| #include "base/files/file_path.h" |
| #include "base/path_service.h" |
| +#include "base/strings/string_util.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "components/component_updater/component_updater_paths.h" |
| @@ -23,7 +24,7 @@ |
| // "revoked-tokens": "<base64-encoded data>" |
| // } |
| // |
| -// TODO(iclelland): Implement support for revoked tokens and disabled features. |
| +// TODO(iclelland): Implement support for revoked tokens. |
| // |
| // If the component is not present in the user data directory, the default |
| // configuration will be used. |
| @@ -72,6 +73,24 @@ void OriginTrialsComponentInstallerTraits::ComponentReady( |
| command_line->AppendSwitchASCII(switches::kOriginTrialPublicKey, |
| override_public_key); |
| } |
| + base::ListValue* override_disabled_feature_list; |
| + if (manifest->GetList("origin-trials.disabled-features", |
| + &override_disabled_feature_list)) { |
| + std::string disabled_feature; |
| + std::vector<std::string> disabled_features; |
| + for (const auto& item : *override_disabled_feature_list) { |
| + if (item->GetAsString(&disabled_feature)) { |
| + disabled_features.push_back(disabled_feature); |
| + } |
| + } |
| + if (!disabled_features.empty()) { |
| + std::string override_disabled_features = |
| + base::JoinString(disabled_features, "|"); |
| + base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| + command_line->AppendSwitchASCII(switches::kOriginTrialDisabledFeatures, |
| + override_disabled_features); |
|
waffles
2016/05/27 17:10:06
Hm, are you sure this will run in time? ComponentR
iclelland
2016/05/30 18:54:06
That's a good question -- It appears to be run in
iclelland
2016/05/31 14:50:13
So the StartupTaskRunner in BrowserMainLoop is blo
|
| + } |
| + } |
| } |
| base::FilePath OriginTrialsComponentInstallerTraits::GetRelativeInstallDir() |