Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: trunk/src/chrome/browser/chromeos/login/wallpaper_manager.cc

Issue 14824006: Revert 198820 "Move FileEnumerator to its own file, do some refa..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
13 #include "base/files/file_path.h" 12 #include "base/files/file_path.h"
14 #include "base/logging.h" 13 #include "base/logging.h"
15 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
16 #include "base/path_service.h" 15 #include "base/path_service.h"
17 #include "base/prefs/pref_registry_simple.h" 16 #include "base/prefs/pref_registry_simple.h"
18 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
19 #include "base/string_util.h" 18 #include "base/string_util.h"
20 #include "base/stringprintf.h" 19 #include "base/stringprintf.h"
21 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
22 #include "base/threading/worker_pool.h" 21 #include "base/threading/worker_pool.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 DictionaryPrefUpdate wallpaper_properties_pref(prefs, 677 DictionaryPrefUpdate wallpaper_properties_pref(prefs,
679 kUserWallpapersProperties); 678 kUserWallpapersProperties);
680 wallpaper_properties_pref->Clear(); 679 wallpaper_properties_pref->Clear();
681 DictionaryPrefUpdate wallpapers_pref(prefs, kUserWallpapers); 680 DictionaryPrefUpdate wallpapers_pref(prefs, kUserWallpapers);
682 wallpapers_pref->Clear(); 681 wallpapers_pref->Clear();
683 } 682 }
684 683
685 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) { 684 void WallpaperManager::DeleteAllExcept(const base::FilePath& path) {
686 base::FilePath dir = path.DirName(); 685 base::FilePath dir = path.DirName();
687 if (file_util::DirectoryExists(dir)) { 686 if (file_util::DirectoryExists(dir)) {
688 base::FileEnumerator files(dir, false, base::FileEnumerator::FILES); 687 file_util::FileEnumerator files(dir, false,
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698