| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 system::StatisticsProvider* statistics_provider, | 270 system::StatisticsProvider* statistics_provider, |
| 271 const std::string& manifest) | 271 const std::string& manifest) |
| 272 : CustomizationDocument(kAcceptedManifestVersion) { | 272 : CustomizationDocument(kAcceptedManifestVersion) { |
| 273 LoadManifestFromString(manifest); | 273 LoadManifestFromString(manifest); |
| 274 Init(statistics_provider); | 274 Init(statistics_provider); |
| 275 } | 275 } |
| 276 | 276 |
| 277 StartupCustomizationDocument::~StartupCustomizationDocument() {} | 277 StartupCustomizationDocument::~StartupCustomizationDocument() {} |
| 278 | 278 |
| 279 StartupCustomizationDocument* StartupCustomizationDocument::GetInstance() { | 279 StartupCustomizationDocument* StartupCustomizationDocument::GetInstance() { |
| 280 return Singleton<StartupCustomizationDocument, | 280 return base::Singleton< |
| 281 DefaultSingletonTraits<StartupCustomizationDocument> >::get(); | 281 StartupCustomizationDocument, |
| 282 base::DefaultSingletonTraits<StartupCustomizationDocument>>::get(); |
| 282 } | 283 } |
| 283 | 284 |
| 284 void StartupCustomizationDocument::Init( | 285 void StartupCustomizationDocument::Init( |
| 285 system::StatisticsProvider* statistics_provider) { | 286 system::StatisticsProvider* statistics_provider) { |
| 286 if (IsReady()) { | 287 if (IsReady()) { |
| 287 root_->GetString(kInitialLocaleAttr, &initial_locale_); | 288 root_->GetString(kInitialLocaleAttr, &initial_locale_); |
| 288 root_->GetString(kInitialTimezoneAttr, &initial_timezone_); | 289 root_->GetString(kInitialTimezoneAttr, &initial_timezone_); |
| 289 root_->GetString(kKeyboardLayoutAttr, &keyboard_layout_); | 290 root_->GetString(kKeyboardLayoutAttr, &keyboard_layout_); |
| 290 | 291 |
| 291 std::string hwid; | 292 std::string hwid; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 LoadManifestFromString(manifest); | 421 LoadManifestFromString(manifest); |
| 421 } | 422 } |
| 422 | 423 |
| 423 ServicesCustomizationDocument::~ServicesCustomizationDocument() {} | 424 ServicesCustomizationDocument::~ServicesCustomizationDocument() {} |
| 424 | 425 |
| 425 // static | 426 // static |
| 426 ServicesCustomizationDocument* ServicesCustomizationDocument::GetInstance() { | 427 ServicesCustomizationDocument* ServicesCustomizationDocument::GetInstance() { |
| 427 if (g_test_services_customization_document) | 428 if (g_test_services_customization_document) |
| 428 return g_test_services_customization_document; | 429 return g_test_services_customization_document; |
| 429 | 430 |
| 430 return Singleton<ServicesCustomizationDocument, | 431 return base::Singleton< |
| 431 DefaultSingletonTraits<ServicesCustomizationDocument> >::get(); | 432 ServicesCustomizationDocument, |
| 433 base::DefaultSingletonTraits<ServicesCustomizationDocument>>::get(); |
| 432 } | 434 } |
| 433 | 435 |
| 434 // static | 436 // static |
| 435 void ServicesCustomizationDocument::RegisterPrefs( | 437 void ServicesCustomizationDocument::RegisterPrefs( |
| 436 PrefRegistrySimple* registry) { | 438 PrefRegistrySimple* registry) { |
| 437 registry->RegisterBooleanPref(kServicesCustomizationAppliedPref, false); | 439 registry->RegisterBooleanPref(kServicesCustomizationAppliedPref, false); |
| 438 registry->RegisterStringPref(prefs::kCustomizationDefaultWallpaperURL, | 440 registry->RegisterStringPref(prefs::kCustomizationDefaultWallpaperURL, |
| 439 std::string()); | 441 std::string()); |
| 440 } | 442 } |
| 441 | 443 |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 apply_tasks_success_ += success; | 956 apply_tasks_success_ += success; |
| 955 | 957 |
| 956 if (apply_tasks_started_ != apply_tasks_finished_) | 958 if (apply_tasks_started_ != apply_tasks_finished_) |
| 957 return; | 959 return; |
| 958 | 960 |
| 959 if (apply_tasks_success_ == apply_tasks_finished_) | 961 if (apply_tasks_success_ == apply_tasks_finished_) |
| 960 SetApplied(true); | 962 SetApplied(true); |
| 961 } | 963 } |
| 962 | 964 |
| 963 } // namespace chromeos | 965 } // namespace chromeos |
| OLD | NEW |