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

Unified Diff: chrome/browser/component_updater/origin_trials_component_installer.cc

Issue 2047683002: Store Origin Trials public key in browser prefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase; update SetupOriginTrials method name Created 4 years, 6 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d6f60608c24f312eab97a0dde98f59aec2a0af0d 100644
--- a/chrome/browser/component_updater/origin_trials_component_installer.cc
+++ b/chrome/browser/component_updater/origin_trials_component_installer.cc
@@ -8,8 +8,12 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
+#include "base/values.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/pref_names.h"
#include "components/component_updater/component_updater_paths.h"
+#include "components/prefs/pref_service.h"
// The client-side configuration for the origin trial framework can be
// overridden by an installed component named 'OriginTrials' (extension id
@@ -65,12 +69,13 @@ void OriginTrialsComponentInstallerTraits::ComponentReady(
const base::Version& version,
const base::FilePath& install_dir,
std::unique_ptr<base::DictionaryValue> manifest) {
- // Read the public key from the manifest and set the command line.
+ // Read the public key from the manifest and set values in browser
+ // local_state. These will be used on the next browser restart.
+ PrefService* local_state = g_browser_process->local_state();
std::string override_public_key;
if (manifest->GetString("origin-trials.public-key", &override_public_key)) {
- base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- command_line->AppendSwitchASCII(switches::kOriginTrialPublicKey,
- override_public_key);
+ local_state->Set(prefs::kOriginTrialPublicKey,
+ base::StringValue(override_public_key));
}
}
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698