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

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

Issue 10141006: [cros] Add support for locale specific configuration in mobile config. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/chromeos/mobile_config.h ('k') | chrome/browser/chromeos/mobile_config_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/mobile_config.cc
diff --git a/chrome/browser/chromeos/mobile_config.cc b/chrome/browser/chromeos/mobile_config.cc
index a655ae28e8396931f5eec6c6a9d3037104edef12..0fbb47923fa86d525be61bd5603201643aaf9d87 100644
--- a/chrome/browser/chromeos/mobile_config.cc
+++ b/chrome/browser/chromeos/mobile_config.cc
@@ -44,6 +44,10 @@ const char kDealExpireDateAttr[] = "expire_date";
const char kLocalizedContentAttr[] = "localized_content";
const char kNotificationTextAttr[] = "notification_text";
+// Initial locale carrier config attributes.
+const char kInitialLocalesAttr[] = "initial_locales";
+const char kSetupURLAttr[] = "setup_url";
+
// Local config properties.
const char kExcludeDealsAttr[] = "exclude_deals";
@@ -192,6 +196,20 @@ void MobileConfig::Carrier::RemoveDeals() {
STLDeleteValues(&deals_);
}
+// MobileConfig::LocaleConfig implementation. ----------------------------------
+
+MobileConfig::LocaleConfig::LocaleConfig(DictionaryValue* locale_dict) {
+ InitFromDictionary(locale_dict);
+}
+
+MobileConfig::LocaleConfig::~LocaleConfig() {
+}
+
+void MobileConfig::LocaleConfig::InitFromDictionary(
+ base::DictionaryValue* locale_dict) {
+ locale_dict->GetString(kSetupURLAttr, &setup_url_);
+}
+
// MobileConfig implementation, public -----------------------------------------
// static
@@ -215,6 +233,10 @@ const MobileConfig::Carrier* MobileConfig::GetCarrier(
return NULL;
}
+const MobileConfig::LocaleConfig* MobileConfig::GetLocaleConfig() const {
+ return locale_config_.get();
+}
+
// MobileConfig implementation, protected --------------------------------------
bool MobileConfig::LoadManifestFromString(const std::string& manifest) {
@@ -264,6 +286,17 @@ bool MobileConfig::LoadManifestFromString(const std::string& manifest) {
}
}
+ DictionaryValue* initial_locales = NULL;
+ if (root_.get() && root_->GetDictionary(kInitialLocalesAttr,
+ &initial_locales)) {
+ DictionaryValue* locale_config_dict = NULL;
+ // Search for a config based on current initial locale.
+ if (initial_locales->GetDictionary(initial_locale_,
+ &locale_config_dict)) {
+ locale_config_.reset(new LocaleConfig(locale_config_dict));
+ }
+ }
+
return true;
}
« no previous file with comments | « chrome/browser/chromeos/mobile_config.h ('k') | chrome/browser/chromeos/mobile_config_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698