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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 DictionaryPrefUpdate wallpaper_properties_pref(prefs, | 678 DictionaryPrefUpdate wallpaper_properties_pref(prefs, |
678 kUserWallpapersProperties); | 679 kUserWallpapersProperties); |
679 wallpaper_properties_pref->Clear(); | 680 wallpaper_properties_pref->Clear(); |
680 DictionaryPrefUpdate wallpapers_pref(prefs, kUserWallpapers); | 681 DictionaryPrefUpdate wallpapers_pref(prefs, kUserWallpapers); |
681 wallpapers_pref->Clear(); | 682 wallpapers_pref->Clear(); |
682 } | 683 } |
683 | 684 |
684 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) { | 685 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) { |
685 base::FilePath dir = path.DirName(); | 686 base::FilePath dir = path.DirName(); |
686 if (file_util::DirectoryExists(dir)) { | 687 if (file_util::DirectoryExists(dir)) { |
687 file_util::FileEnumerator files(dir, false, | 688 base::FileEnumerator files(dir, false, base::FileEnumerator::FILES); |
688 file_util::FileEnumerator::FILES); | |
689 for (base::FilePath current = files.Next(); !current.empty(); | 689 for (base::FilePath current = files.Next(); !current.empty(); |
690 current = files.Next()) { | 690 current = files.Next()) { |
691 if (current != path) | 691 if (current != path) |
692 file_util::Delete(current, false); | 692 file_util::Delete(current, false); |
693 } | 693 } |
694 } | 694 } |
695 } | 695 } |
696 | 696 |
697 void WallpaperManager::DeleteWallpaperInList( | 697 void WallpaperManager::DeleteWallpaperInList( |
698 const std::vector<base::FilePath>& file_list) { | 698 const std::vector<base::FilePath>& file_list) { |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 | 1107 |
1108 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { | 1108 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { |
1109 BatchUpdateWallpaper(); | 1109 BatchUpdateWallpaper(); |
1110 } | 1110 } |
1111 | 1111 |
1112 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { | 1112 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { |
1113 RestartTimer(); | 1113 RestartTimer(); |
1114 } | 1114 } |
1115 | 1115 |
1116 } // chromeos | 1116 } // chromeos |
OLD | NEW |