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

Unified Diff: chrome/browser/chromeos/customization_document.cc

Issue 144363006: Expand VPD initial_locale to a list of locales. Use the expanded VPD initial_locale on the OOBE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unittests added. Created 6 years, 11 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
Index: chrome/browser/chromeos/customization_document.cc
diff --git a/chrome/browser/chromeos/customization_document.cc b/chrome/browser/chromeos/customization_document.cc
index f61cc8655bc738e42d2419573a8f2014c579891f..fbff1b6944be5eec368c26c131ca6214b31beca6 100644
--- a/chrome/browser/chromeos/customization_document.cc
+++ b/chrome/browser/chromeos/customization_document.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/prefs/pref_registry_simple.h"
#include "base/prefs/pref_service.h"
+#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
@@ -212,6 +213,22 @@ void StartupCustomizationDocument::Init(
&initial_timezone_);
statistics_provider->GetMachineStatistic(kKeyboardLayoutAttr,
&keyboard_layout_);
+ configured_locales_.resize(0);
+ base::SplitString(initial_locale_, ',', &configured_locales_);
+ // Let's always have configured_locales_.front() a valid entry.
+ if (configured_locales_.size() == 0)
+ configured_locales_.push_back(std::string());
+}
+
+const std::vector<std::string>&
+StartupCustomizationDocument::configured_locales() const {
+ return configured_locales_;
+}
+
+const std::string& StartupCustomizationDocument::initial_locale_default()
+ const {
+ DCHECK(configured_locales_.size() > 0);
+ return configured_locales_.front();
}
std::string StartupCustomizationDocument::GetHelpPage(

Powered by Google App Engine
This is Rietveld 408576698