OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/origin_trials/origin_trial_controller.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/command_line.h" |
| 10 #include "chrome/common/chrome_switches.h" |
| 11 #include "components/variations/variations_associated_data.h" |
| 12 |
| 13 const char OriginTrialController::kFieldTrialName[] = "OriginTrials"; |
| 14 const char OriginTrialController::kPublicKeyFieldName[] = "PublicKey"; |
| 15 |
| 16 // static |
| 17 void OriginTrialController::UpdateCommandLineFromFieldTrials( |
| 18 base::CommandLine* command_line) { |
| 19 std::map<std::string, std::string> field_params; |
| 20 if (!variations::GetVariationParams(kFieldTrialName, &field_params)) |
| 21 return; |
| 22 |
| 23 std::string override_public_key = field_params[kPublicKeyFieldName]; |
| 24 if (!override_public_key.empty()) { |
| 25 command_line->AppendSwitchASCII(switches::kOriginTrialPublicKey, |
| 26 override_public_key); |
| 27 } |
| 28 } |
OLD | NEW |