summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/master_preferences.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/util/master_preferences.cc')
-rw-r--r--chrome/installer/util/master_preferences.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 2a6a4e7..3406e33 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -65,6 +65,27 @@ bool GetDistroBooleanPreference(const DictionaryValue* prefs,
return true;
}
+bool GetDistroStringPreference(const DictionaryValue* prefs,
+ const std::wstring& name,
+ std::wstring* value) {
+ if (!prefs || !value)
+ return false;
+
+ DictionaryValue* distro = NULL;
+ if (!prefs->GetDictionary(kDistroDict, &distro) || !distro)
+ return false;
+
+ std::wstring str_value;
+ if (!distro->GetString(name, &str_value))
+ return false;
+
+ if (str_value.empty())
+ return false;
+
+ *value = str_value;
+ return true;
+}
+
bool GetDistroIntegerPreference(const DictionaryValue* prefs,
const std::wstring& name,
int* value) {