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_document.h" | 5 #include "chrome/browser/chromeos/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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 // static | 451 // static |
452 bool ServicesCustomizationDocument::WasOOBECustomizationApplied() { | 452 bool ServicesCustomizationDocument::WasOOBECustomizationApplied() { |
453 PrefService* prefs = g_browser_process->local_state(); | 453 PrefService* prefs = g_browser_process->local_state(); |
454 // prefs can be NULL in some tests. | 454 // prefs can be NULL in some tests. |
455 if (prefs) | 455 if (prefs) |
456 return prefs->GetBoolean(kServicesCustomizationAppliedPref); | 456 return prefs->GetBoolean(kServicesCustomizationAppliedPref); |
457 else | 457 else |
458 return false; | 458 return false; |
459 } | 459 } |
460 | 460 |
| 461 CustomizationWallpaperDownloader* |
| 462 ServicesCustomizationDocument::GetWallpaperDownloaderForTesting() const { |
| 463 return wallpaper_downloader_.get(); |
| 464 } |
| 465 |
461 // static | 466 // static |
462 void ServicesCustomizationDocument::SetApplied(bool val) { | 467 void ServicesCustomizationDocument::SetApplied(bool val) { |
463 PrefService* prefs = g_browser_process->local_state(); | 468 PrefService* prefs = g_browser_process->local_state(); |
464 // prefs can be NULL in some tests. | 469 // prefs can be NULL in some tests. |
465 if (prefs) | 470 if (prefs) |
466 prefs->SetBoolean(kServicesCustomizationAppliedPref, val); | 471 prefs->SetBoolean(kServicesCustomizationAppliedPref, val); |
467 } | 472 } |
468 | 473 |
469 // static | 474 // static |
470 base::FilePath ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir() { | 475 base::FilePath ServicesCustomizationDocument::GetCustomizedWallpaperCacheDir() { |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
960 apply_tasks_success_ += success; | 965 apply_tasks_success_ += success; |
961 | 966 |
962 if (apply_tasks_started_ != apply_tasks_finished_) | 967 if (apply_tasks_started_ != apply_tasks_finished_) |
963 return; | 968 return; |
964 | 969 |
965 if (apply_tasks_success_ == apply_tasks_finished_) | 970 if (apply_tasks_success_ == apply_tasks_finished_) |
966 SetApplied(true); | 971 SetApplied(true); |
967 } | 972 } |
968 | 973 |
969 } // namespace chromeos | 974 } // namespace chromeos |
OLD | NEW |