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

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

Issue 7659009: Apply VPD customization even if startup customization manifest is missing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments resolved Created 9 years, 4 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 cb6a92e7d52768628d7fabcd3ae3b83fe6f8b529..4f944e634d2efdf9230e4fe60d5dfd77f2a35a2f 100644
--- a/chrome/browser/chromeos/customization_document.cc
+++ b/chrome/browser/chromeos/customization_document.cc
@@ -166,46 +166,46 @@ StartupCustomizationDocument* StartupCustomizationDocument::GetInstance() {
void StartupCustomizationDocument::Init(
chromeos::system::StatisticsProvider* statistics_provider) {
- if (!IsReady())
- return;
-
- root_->GetString(kInitialLocaleAttr, &initial_locale_);
- root_->GetString(kInitialTimezoneAttr, &initial_timezone_);
- root_->GetString(kKeyboardLayoutAttr, &keyboard_layout_);
- root_->GetString(kRegistrationUrlAttr, &registration_url_);
-
- std::string hwid;
- if (statistics_provider->GetMachineStatistic(kHardwareClass, &hwid)) {
- ListValue* hwid_list = NULL;
- if (root_->GetList(kHwidMapAttr, &hwid_list)) {
- for (size_t i = 0; i < hwid_list->GetSize(); ++i) {
- DictionaryValue* hwid_dictionary = NULL;
- std::string hwid_mask;
- if (hwid_list->GetDictionary(i, &hwid_dictionary) &&
- hwid_dictionary->GetString(kHwidMaskAttr, &hwid_mask)) {
- if (MatchPattern(hwid, hwid_mask)) {
- // If HWID for this machine matches some mask, use HWID specific
- // settings.
- std::string result;
- if (hwid_dictionary->GetString(kInitialLocaleAttr, &result))
- initial_locale_ = result;
-
- if (hwid_dictionary->GetString(kInitialTimezoneAttr, &result))
- initial_timezone_ = result;
-
- if (hwid_dictionary->GetString(kKeyboardLayoutAttr, &result))
- keyboard_layout_ = result;
+ if (IsReady()) {
+ root_->GetString(kInitialLocaleAttr, &initial_locale_);
+ root_->GetString(kInitialTimezoneAttr, &initial_timezone_);
+ root_->GetString(kKeyboardLayoutAttr, &keyboard_layout_);
+ root_->GetString(kRegistrationUrlAttr, &registration_url_);
+
+ std::string hwid;
+ if (statistics_provider->GetMachineStatistic(kHardwareClass, &hwid)) {
+ ListValue* hwid_list = NULL;
+ if (root_->GetList(kHwidMapAttr, &hwid_list)) {
+ for (size_t i = 0; i < hwid_list->GetSize(); ++i) {
+ DictionaryValue* hwid_dictionary = NULL;
+ std::string hwid_mask;
+ if (hwid_list->GetDictionary(i, &hwid_dictionary) &&
+ hwid_dictionary->GetString(kHwidMaskAttr, &hwid_mask)) {
+ if (MatchPattern(hwid, hwid_mask)) {
+ // If HWID for this machine matches some mask, use HWID specific
+ // settings.
+ std::string result;
+ if (hwid_dictionary->GetString(kInitialLocaleAttr, &result))
+ initial_locale_ = result;
+
+ if (hwid_dictionary->GetString(kInitialTimezoneAttr, &result))
+ initial_timezone_ = result;
+
+ if (hwid_dictionary->GetString(kKeyboardLayoutAttr, &result))
+ keyboard_layout_ = result;
+ }
+ // Don't break here to allow other entires to be applied if match.
+ } else {
+ LOG(ERROR) << "Syntax error in customization manifest";
}
- // Don't break here to allow other entires to be applied if match.
- } else {
- LOG(ERROR) << "Syntax error in customization manifest";
}
}
+ } else {
+ LOG(ERROR) << "HWID is missing in machine statistics";
}
- } else {
- LOG(ERROR) << "HWID is missing in machine statistics";
}
+ // If manifest doesn't exist still apply values from VPD.
statistics_provider->GetMachineStatistic(kInitialLocaleAttr,
&initial_locale_);
statistics_provider->GetMachineStatistic(kInitialTimezoneAttr,
« no previous file with comments | « chrome/browser/chromeos/customization_document.h ('k') | chrome/browser/chromeos/login/base_login_display_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698