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" |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 std::string email = (*it)->email(); | 844 std::string email = (*it)->email(); |
845 EnsureCustomWallpaperDirectories(email); | 845 EnsureCustomWallpaperDirectories(email); |
846 from_path = GetWallpaperPathForUser(email, true); | 846 from_path = GetWallpaperPathForUser(email, true); |
847 // Old wallpaper with extension name may still exist. | 847 // Old wallpaper with extension name may still exist. |
848 if (!file_util::PathExists(from_path)) | 848 if (!file_util::PathExists(from_path)) |
849 from_path = from_path.AddExtension(".png"); | 849 from_path = from_path.AddExtension(".png"); |
850 if (file_util::PathExists(from_path)) { | 850 if (file_util::PathExists(from_path)) { |
851 // Appends DUMMY to the file name of moved custom wallpaper. This way we | 851 // Appends DUMMY to the file name of moved custom wallpaper. This way we |
852 // do not need to update WallpaperInfo for user. | 852 // do not need to update WallpaperInfo for user. |
853 to_path = GetCustomWallpaperPath(kSmallWallpaperSubDir, email, "DUMMY"); | 853 to_path = GetCustomWallpaperPath(kSmallWallpaperSubDir, email, "DUMMY"); |
854 file_util::Move(from_path, to_path); | 854 base::Move(from_path, to_path); |
855 } | 855 } |
856 from_path = GetWallpaperPathForUser(email, false); | 856 from_path = GetWallpaperPathForUser(email, false); |
857 if (!file_util::PathExists(from_path)) | 857 if (!file_util::PathExists(from_path)) |
858 from_path = from_path.AddExtension(".png"); | 858 from_path = from_path.AddExtension(".png"); |
859 if (file_util::PathExists(from_path)) { | 859 if (file_util::PathExists(from_path)) { |
860 to_path = GetCustomWallpaperPath(kLargeWallpaperSubDir, email, "DUMMY"); | 860 to_path = GetCustomWallpaperPath(kLargeWallpaperSubDir, email, "DUMMY"); |
861 file_util::Move(from_path, to_path); | 861 base::Move(from_path, to_path); |
862 } | 862 } |
863 from_path = GetOriginalWallpaperPathForUser(email); | 863 from_path = GetOriginalWallpaperPathForUser(email); |
864 if (!file_util::PathExists(from_path)) | 864 if (!file_util::PathExists(from_path)) |
865 from_path = from_path.AddExtension(".png"); | 865 from_path = from_path.AddExtension(".png"); |
866 if (file_util::PathExists(from_path)) { | 866 if (file_util::PathExists(from_path)) { |
867 to_path = GetCustomWallpaperPath(kOriginalWallpaperSubDir, email, | 867 to_path = GetCustomWallpaperPath(kOriginalWallpaperSubDir, email, |
868 "DUMMY"); | 868 "DUMMY"); |
869 file_util::Move(from_path, to_path); | 869 base::Move(from_path, to_path); |
870 } | 870 } |
871 } | 871 } |
872 } | 872 } |
873 | 873 |
874 bool WallpaperManager::GetUserWallpaperInfo(const std::string& email, | 874 bool WallpaperManager::GetUserWallpaperInfo(const std::string& email, |
875 WallpaperInfo* info){ | 875 WallpaperInfo* info){ |
876 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 876 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
877 | 877 |
878 if (UserManager::Get()->IsUserNonCryptohomeDataEphemeral(email)) { | 878 if (UserManager::Get()->IsUserNonCryptohomeDataEphemeral(email)) { |
879 // Default to the values cached in memory. | 879 // Default to the values cached in memory. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 | 1095 |
1096 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { | 1096 void WallpaperManager::SystemResumed(const base::TimeDelta& sleep_duration) { |
1097 BatchUpdateWallpaper(); | 1097 BatchUpdateWallpaper(); |
1098 } | 1098 } |
1099 | 1099 |
1100 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { | 1100 void WallpaperManager::TimezoneChanged(const icu::TimeZone& timezone) { |
1101 RestartTimer(); | 1101 RestartTimer(); |
1102 } | 1102 } |
1103 | 1103 |
1104 } // namespace chromeos | 1104 } // namespace chromeos |
OLD | NEW |