OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/customization/customization_document.h" | 5 #include "chrome/browser/chromeos/customization/customization_document.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 } | 322 } |
323 } | 323 } |
324 | 324 |
325 // If manifest doesn't exist still apply values from VPD. | 325 // If manifest doesn't exist still apply values from VPD. |
326 statistics_provider->GetMachineStatistic(kInitialLocaleAttr, | 326 statistics_provider->GetMachineStatistic(kInitialLocaleAttr, |
327 &initial_locale_); | 327 &initial_locale_); |
328 statistics_provider->GetMachineStatistic(kInitialTimezoneAttr, | 328 statistics_provider->GetMachineStatistic(kInitialTimezoneAttr, |
329 &initial_timezone_); | 329 &initial_timezone_); |
330 statistics_provider->GetMachineStatistic(kKeyboardLayoutAttr, | 330 statistics_provider->GetMachineStatistic(kKeyboardLayoutAttr, |
331 &keyboard_layout_); | 331 &keyboard_layout_); |
332 configured_locales_.resize(0); | 332 configured_locales_ = base::SplitString( |
333 base::SplitString(initial_locale_, ',', &configured_locales_); | 333 initial_locale_, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
334 | 334 |
335 // Convert ICU locale to chrome ("en_US" to "en-US", etc.). | 335 // Convert ICU locale to chrome ("en_US" to "en-US", etc.). |
336 std::for_each(configured_locales_.begin(), configured_locales_.end(), | 336 std::for_each(configured_locales_.begin(), configured_locales_.end(), |
337 base::i18n::GetCanonicalLocale); | 337 base::i18n::GetCanonicalLocale); |
338 | 338 |
339 // Let's always have configured_locales_.front() a valid entry. | 339 // Let's always have configured_locales_.front() a valid entry. |
340 if (configured_locales_.size() == 0) | 340 if (configured_locales_.size() == 0) |
341 configured_locales_.push_back(std::string()); | 341 configured_locales_.push_back(std::string()); |
342 } | 342 } |
343 | 343 |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 apply_tasks_success_ += success; | 954 apply_tasks_success_ += success; |
955 | 955 |
956 if (apply_tasks_started_ != apply_tasks_finished_) | 956 if (apply_tasks_started_ != apply_tasks_finished_) |
957 return; | 957 return; |
958 | 958 |
959 if (apply_tasks_success_ == apply_tasks_finished_) | 959 if (apply_tasks_success_ == apply_tasks_finished_) |
960 SetApplied(true); | 960 SetApplied(true); |
961 } | 961 } |
962 | 962 |
963 } // namespace chromeos | 963 } // namespace chromeos |
OLD | NEW |