summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 06:36:03 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 06:36:03 +0000
commita723f0af50bf919cfbcfd7f8f1c05fee1c3f3c67 (patch)
tree362928a12d5cff2235e363a6b4b1cdef2bb1a044 /chrome/installer
parent900761ca90361bc35094b21185c8936e1f47fe6d (diff)
downloadchromium_src-a723f0af50bf919cfbcfd7f8f1c05fee1c3f3c67.zip
chromium_src-a723f0af50bf919cfbcfd7f8f1c05fee1c3f3c67.tar.gz
chromium_src-a723f0af50bf919cfbcfd7f8f1c05fee1c3f3c67.tar.bz2
Support variations_seed parameter in MasterPrefs.
Also, cleans up SetupMasterPrefsFromInstallPrefs() to be more conformant to the style guide and adds a unit test. BUG=175476 TEST=Test that specifying a custom variations_seed in a master prefs file to the installer (via --installerdata=path), results in that seed being used on first run. Review URL: https://chromiumcodereview.appspot.com/12223062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182631 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/util/master_preferences.cc7
-rw-r--r--chrome/installer/util/master_preferences.h3
2 files changed, 10 insertions, 0 deletions
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index cb8c5d6..f423964 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -12,6 +12,7 @@
#include "base/path_service.h"
#include "base/string_util.h"
#include "chrome/common/env_vars.h"
+#include "chrome/common/pref_names.h"
#include "chrome/installer/util/master_preferences_constants.h"
#include "chrome/installer/util/util_constants.h"
#include "googleurl/src/gurl.h"
@@ -314,6 +315,12 @@ bool MasterPreferences::GetExtensionsBlock(DictionaryValue** extensions) const {
master_preferences::kExtensionsBlock, extensions);
}
+std::string MasterPreferences::GetVariationsSeed() const {
+ std::string variations_seed;
+ master_dictionary_->GetString(prefs::kVariationsSeed, &variations_seed);
+ return variations_seed;
+}
+
// static
const MasterPreferences& MasterPreferences::ForCurrentProcess() {
return g_master_preferences.Get();
diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h
index 773d603..931e394 100644
--- a/chrome/installer/util/master_preferences.h
+++ b/chrome/installer/util/master_preferences.h
@@ -158,6 +158,9 @@ class MasterPreferences {
//
bool GetExtensionsBlock(base::DictionaryValue** extensions) const;
+ // Returns the variations seed entry from the master prefs.
+ std::string GetVariationsSeed() const;
+
// Returns true iff the master preferences were successfully read from a file.
bool read_from_file() const {
return preferences_read_from_file_;