| 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/mobile_config.h" | 5 #include "chrome/browser/chromeos/mobile_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/json/json_reader.h" | 12 #include "base/json/json_reader.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/chromeos/login/wizard_controller.h" | 17 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 18 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 19 | 19 |
| 20 using content::BrowserThread; | 20 using content::BrowserThread; |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Config attributes names. | 24 // Config attributes names. |
| 25 const char kVersionAttr[] = "version"; | 25 const char kVersionAttr[] = "version"; |
| 26 const char kAcceptedConfigVersion[] = "1.0"; | 26 const char kAcceptedConfigVersion[] = "1.0"; |
| 27 const char kDefaultAttr[] = "default"; | 27 const char kDefaultAttr[] = "default"; |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 } | 298 } |
| 299 } | 299 } |
| 300 | 300 |
| 301 return true; | 301 return true; |
| 302 } | 302 } |
| 303 | 303 |
| 304 // MobileConfig implementation, private ---------------------------------------- | 304 // MobileConfig implementation, private ---------------------------------------- |
| 305 | 305 |
| 306 MobileConfig::MobileConfig() | 306 MobileConfig::MobileConfig() |
| 307 : CustomizationDocument(kAcceptedConfigVersion), | 307 : CustomizationDocument(kAcceptedConfigVersion), |
| 308 initial_locale_(WizardController::GetInitialLocale()) { | 308 initial_locale_(StartupUtils::GetInitialLocale()) { |
| 309 LoadConfig(); | 309 LoadConfig(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 MobileConfig::MobileConfig(const std::string& config, | 312 MobileConfig::MobileConfig(const std::string& config, |
| 313 const std::string& initial_locale) | 313 const std::string& initial_locale) |
| 314 : CustomizationDocument(kAcceptedConfigVersion), | 314 : CustomizationDocument(kAcceptedConfigVersion), |
| 315 initial_locale_(initial_locale) { | 315 initial_locale_(initial_locale) { |
| 316 LoadManifestFromString(config); | 316 LoadManifestFromString(config); |
| 317 } | 317 } |
| 318 | 318 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 << local_config_file.value(); | 369 << local_config_file.value(); |
| 370 } | 370 } |
| 371 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 371 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 372 base::Bind(&MobileConfig::ProcessConfig, | 372 base::Bind(&MobileConfig::ProcessConfig, |
| 373 base::Unretained(this), // singleton. | 373 base::Unretained(this), // singleton. |
| 374 global_config, | 374 global_config, |
| 375 local_config)); | 375 local_config)); |
| 376 } | 376 } |
| 377 | 377 |
| 378 } // namespace chromeos | 378 } // namespace chromeos |
| OLD | NEW |