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" |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
14 #include "base/json/json_reader.h" | 14 #include "base/json/json_reader.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/metrics/histogram.h" | 17 #include "base/metrics/histogram.h" |
18 #include "base/path_service.h" | 18 #include "base/path_service.h" |
19 #include "base/prefs/pref_registry_simple.h" | 19 #include "base/prefs/pref_registry_simple.h" |
20 #include "base/prefs/pref_service.h" | 20 #include "base/prefs/pref_service.h" |
| 21 #include "base/strings/pattern.h" |
21 #include "base/strings/string_split.h" | 22 #include "base/strings/string_split.h" |
22 #include "base/strings/string_util.h" | 23 #include "base/strings/string_util.h" |
23 #include "base/strings/stringprintf.h" | 24 #include "base/strings/stringprintf.h" |
24 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
25 #include "base/time/time.h" | 26 #include "base/time/time.h" |
26 #include "chrome/browser/browser_process.h" | 27 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/chromeos/customization/customization_wallpaper_download
er.h" | 28 #include "chrome/browser/chromeos/customization/customization_wallpaper_download
er.h" |
28 #include "chrome/browser/chromeos/extensions/default_app_order.h" | 29 #include "chrome/browser/chromeos/extensions/default_app_order.h" |
29 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 30 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
30 #include "chrome/browser/chromeos/login/wizard_controller.h" | 31 #include "chrome/browser/chromeos/login/wizard_controller.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 std::string hwid; | 291 std::string hwid; |
291 if (statistics_provider->GetMachineStatistic( | 292 if (statistics_provider->GetMachineStatistic( |
292 system::kHardwareClassKey, &hwid)) { | 293 system::kHardwareClassKey, &hwid)) { |
293 base::ListValue* hwid_list = NULL; | 294 base::ListValue* hwid_list = NULL; |
294 if (root_->GetList(kHwidMapAttr, &hwid_list)) { | 295 if (root_->GetList(kHwidMapAttr, &hwid_list)) { |
295 for (size_t i = 0; i < hwid_list->GetSize(); ++i) { | 296 for (size_t i = 0; i < hwid_list->GetSize(); ++i) { |
296 base::DictionaryValue* hwid_dictionary = NULL; | 297 base::DictionaryValue* hwid_dictionary = NULL; |
297 std::string hwid_mask; | 298 std::string hwid_mask; |
298 if (hwid_list->GetDictionary(i, &hwid_dictionary) && | 299 if (hwid_list->GetDictionary(i, &hwid_dictionary) && |
299 hwid_dictionary->GetString(kHwidMaskAttr, &hwid_mask)) { | 300 hwid_dictionary->GetString(kHwidMaskAttr, &hwid_mask)) { |
300 if (MatchPattern(hwid, hwid_mask)) { | 301 if (base::MatchPattern(hwid, hwid_mask)) { |
301 // If HWID for this machine matches some mask, use HWID specific | 302 // If HWID for this machine matches some mask, use HWID specific |
302 // settings. | 303 // settings. |
303 std::string result; | 304 std::string result; |
304 if (hwid_dictionary->GetString(kInitialLocaleAttr, &result)) | 305 if (hwid_dictionary->GetString(kInitialLocaleAttr, &result)) |
305 initial_locale_ = result; | 306 initial_locale_ = result; |
306 | 307 |
307 if (hwid_dictionary->GetString(kInitialTimezoneAttr, &result)) | 308 if (hwid_dictionary->GetString(kInitialTimezoneAttr, &result)) |
308 initial_timezone_ = result; | 309 initial_timezone_ = result; |
309 | 310 |
310 if (hwid_dictionary->GetString(kKeyboardLayoutAttr, &result)) | 311 if (hwid_dictionary->GetString(kKeyboardLayoutAttr, &result)) |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
953 apply_tasks_success_ += success; | 954 apply_tasks_success_ += success; |
954 | 955 |
955 if (apply_tasks_started_ != apply_tasks_finished_) | 956 if (apply_tasks_started_ != apply_tasks_finished_) |
956 return; | 957 return; |
957 | 958 |
958 if (apply_tasks_success_ == apply_tasks_finished_) | 959 if (apply_tasks_success_ == apply_tasks_finished_) |
959 SetApplied(true); | 960 SetApplied(true); |
960 } | 961 } |
961 | 962 |
962 } // namespace chromeos | 963 } // namespace chromeos |
OLD | NEW |