| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/login/wallpaper_manager.h" | 5 #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/files/file_enumerator.h" |
| 12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 13 #include "base/logging.h" | 14 #include "base/logging.h" |
| 14 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 16 #include "base/prefs/pref_registry_simple.h" | 17 #include "base/prefs/pref_registry_simple.h" |
| 17 #include "base/prefs/pref_service.h" | 18 #include "base/prefs/pref_service.h" |
| 18 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 19 #include "base/stringprintf.h" | 20 #include "base/stringprintf.h" |
| 20 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
| 21 #include "base/threading/worker_pool.h" | 22 #include "base/threading/worker_pool.h" |
| (...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 DictionaryPrefUpdate wallpaper_properties_pref(prefs, | 679 DictionaryPrefUpdate wallpaper_properties_pref(prefs, |
| 679 kUserWallpapersProperties); | 680 kUserWallpapersProperties); |
| 680 wallpaper_properties_pref->Clear(); | 681 wallpaper_properties_pref->Clear(); |
| 681 DictionaryPrefUpdate wallpapers_pref(prefs, kUserWallpapers); | 682 DictionaryPrefUpdate wallpapers_pref(prefs, kUserWallpapers); |
| 682 wallpapers_pref->Clear(); | 683 wallpapers_pref->Clear(); |
| 683 } | 684 } |
| 684 | 685 |
| 685 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) { | 686 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) { |
| 686 base::FilePath dir = path.DirName(); | 687 base::FilePath dir = path.DirName(); |
| 687 if (file_util::DirectoryExists(dir)) { | 688 if (file_util::DirectoryExists(dir)) { |
| 688 file_util::FileEnumerator files(dir, false, | 689 base::FileEnumerator files(dir, false, base::FileEnumerator::FILES); |
| 689 file_util::FileEnumerator::FILES); | |
| 690 for (base::FilePath current = files.Next(); !current.empty(); | 690 for (base::FilePath current = files.Next(); !current.empty(); |
| 691 current = files.Next()) { | 691 current = files.Next()) { |
| 692 if (current != path) | 692 if (current != path) |
| 693 file_util::Delete(current, false); | 693 file_util::Delete(current, false); |
| 694 } | 694 } |
| 695 } | 695 } |
| 696 } | 696 } |
| 697 | 697 |
| 698 void WallpaperManager::DeleteWallpaperInList( | 698 void WallpaperManager::DeleteWallpaperInList( |
| 699 const std::vector<base::FilePath>& file_list) { | 699 const std::vector<base::FilePath>& file_list) { |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 | 1108 |
| 1109 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { | 1109 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { |
| 1110 BatchUpdateWallpaper(); | 1110 BatchUpdateWallpaper(); |
| 1111 } | 1111 } |
| 1112 | 1112 |
| 1113 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { | 1113 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { |
| 1114 RestartTimer(); | 1114 RestartTimer(); |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 } // chromeos | 1117 } // chromeos |
| OLD | NEW |