| Index: chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| diff --git a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| index baf6168e5f737dbbe34be9f31d40cb95113c145f..1b867867835b891ed39dae107cc5a158d132f2be 100644
|
| --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| @@ -545,7 +545,7 @@ void WallpaperManager::EnsureLoggedInUserWallpaperLoaded() {
|
| if (info == current_user_wallpaper_info_)
|
| return;
|
| }
|
| - SetUserWallpaperNow(UserManager::Get()->GetLoggedInUser()->email());
|
| + SetUserWallpaperNow(GetUserManager()->GetLoggedInUser()->email());
|
| }
|
|
|
| void WallpaperManager::ClearDisposableWallpaperCache() {
|
| @@ -553,7 +553,7 @@ void WallpaperManager::ClearDisposableWallpaperCache() {
|
| weak_factory_.InvalidateWeakPtrs();
|
| // Keep the wallpaper of logged in users in cache at multi-profile mode.
|
| std::set<std::string> logged_in_users_names;
|
| - const UserList& logged_users = UserManager::Get()->GetLoggedInUsers();
|
| + const UserList& logged_users = GetUserManager()->GetLoggedInUsers();
|
| for (UserList::const_iterator it = logged_users.begin();
|
| it != logged_users.end();
|
| ++it) {
|
| @@ -574,7 +574,7 @@ void WallpaperManager::ClearDisposableWallpaperCache() {
|
| bool WallpaperManager::GetLoggedInUserWallpaperInfo(WallpaperInfo* info) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| - if (UserManager::Get()->IsLoggedInAsStub()) {
|
| + if (GetUserManager()->IsLoggedInAsStub()) {
|
| info->file = current_user_wallpaper_info_.file = "";
|
| info->layout = current_user_wallpaper_info_.layout =
|
| ash::WALLPAPER_LAYOUT_CENTER_CROPPED;
|
| @@ -584,13 +584,13 @@ bool WallpaperManager::GetLoggedInUserWallpaperInfo(WallpaperInfo* info) {
|
| return true;
|
| }
|
|
|
| - return GetUserWallpaperInfo(UserManager::Get()->GetLoggedInUser()->email(),
|
| + return GetUserWallpaperInfo(GetUserManager()->GetLoggedInUser()->email(),
|
| info);
|
| }
|
|
|
| void WallpaperManager::InitializeWallpaper() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - UserManager* user_manager = UserManager::Get();
|
| + UserManager* user_manager = GetUserManager();
|
|
|
| // Apply device customization.
|
| if (ShouldUseCustomizedDefaultWallpaper()) {
|
| @@ -834,7 +834,7 @@ base::FilePath WallpaperManager::GetCustomWallpaperPath(
|
| void WallpaperManager::SetPolicyControlledWallpaper(
|
| const std::string& user_id,
|
| const UserImage& user_image) {
|
| - const User *user = chromeos::UserManager::Get()->FindUser(user_id);
|
| + const User* user = chromeos::GetUserManager()->FindUser(user_id);
|
| if (!user) {
|
| NOTREACHED() << "Unknown user.";
|
| return;
|
| @@ -856,10 +856,10 @@ void WallpaperManager::SetCustomWallpaper(const std::string& user_id,
|
| const gfx::ImageSkia& image,
|
| bool update_wallpaper) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - DCHECK(UserManager::Get()->IsUserLoggedIn());
|
| + DCHECK(GetUserManager()->IsUserLoggedIn());
|
|
|
| // There is no visible background in kiosk mode.
|
| - if (UserManager::Get()->IsLoggedInAsKioskApp())
|
| + if (GetUserManager()->IsLoggedInAsKioskApp())
|
| return;
|
|
|
| // Don't allow custom wallpapers while policy is in effect.
|
| @@ -877,7 +877,7 @@ void WallpaperManager::SetCustomWallpaper(const std::string& user_id,
|
| }
|
|
|
| bool is_persistent =
|
| - !UserManager::Get()->IsUserNonCryptohomeDataEphemeral(user_id);
|
| + !GetUserManager()->IsUserNonCryptohomeDataEphemeral(user_id);
|
|
|
| WallpaperInfo wallpaper_info = {
|
| wallpaper_path.value(),
|
| @@ -934,7 +934,7 @@ void WallpaperManager::DoSetDefaultWallpaper(
|
| const std::string& user_id,
|
| MovableOnDestroyCallbackHolder on_finish) {
|
| // There is no visible background in kiosk mode.
|
| - if (UserManager::Get()->IsLoggedInAsKioskApp())
|
| + if (GetUserManager()->IsLoggedInAsKioskApp())
|
| return;
|
| current_wallpaper_path_.clear();
|
| wallpaper_cache_.erase(user_id);
|
| @@ -949,7 +949,7 @@ void WallpaperManager::DoSetDefaultWallpaper(
|
|
|
| const base::FilePath* file = NULL;
|
|
|
| - if (UserManager::Get()->IsLoggedInAsGuest()) {
|
| + if (GetUserManager()->IsLoggedInAsGuest()) {
|
| file =
|
| use_small ? &guest_small_wallpaper_file_ : &guest_large_wallpaper_file_;
|
| } else {
|
| @@ -1145,18 +1145,18 @@ void WallpaperManager::ScheduleSetUserWallpaper(const std::string& user_id,
|
| if (!UserManager::IsInitialized() || !g_browser_process->local_state())
|
| return;
|
| // There is no visible background in kiosk mode.
|
| - if (UserManager::Get()->IsLoggedInAsKioskApp())
|
| + if (GetUserManager()->IsLoggedInAsKioskApp())
|
| return;
|
| // Guest user, regular user in ephemeral mode, or kiosk app.
|
| - const User* user = UserManager::Get()->FindUser(user_id);
|
| - if (UserManager::Get()->IsUserNonCryptohomeDataEphemeral(user_id) ||
|
| + const User* user = GetUserManager()->FindUser(user_id);
|
| + if (GetUserManager()->IsUserNonCryptohomeDataEphemeral(user_id) ||
|
| (user != NULL && user->GetType() == user_manager::USER_TYPE_KIOSK_APP)) {
|
| InitInitialUserWallpaper(user_id, false);
|
| GetPendingWallpaper(user_id, delayed)->ResetSetDefaultWallpaper();
|
| return;
|
| }
|
|
|
| - if (!UserManager::Get()->IsKnownUser(user_id))
|
| + if (!GetUserManager()->IsKnownUser(user_id))
|
| return;
|
|
|
| last_selected_user_ = user_id;
|
| @@ -1209,10 +1209,10 @@ void WallpaperManager::SetWallpaperFromImageSkia(const std::string& user_id,
|
| const gfx::ImageSkia& image,
|
| ash::WallpaperLayout layout,
|
| bool update_wallpaper) {
|
| - DCHECK(UserManager::Get()->IsUserLoggedIn());
|
| + DCHECK(GetUserManager()->IsUserLoggedIn());
|
|
|
| // There is no visible background in kiosk mode.
|
| - if (UserManager::Get()->IsLoggedInAsKioskApp())
|
| + if (GetUserManager()->IsLoggedInAsKioskApp())
|
| return;
|
| WallpaperInfo info;
|
| info.layout = layout;
|
| @@ -1268,7 +1268,7 @@ bool WallpaperManager::GetWallpaperFromCache(const std::string& user_id,
|
|
|
| void WallpaperManager::CacheUsersWallpapers() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - UserList users = UserManager::Get()->GetUsers();
|
| + UserList users = GetUserManager()->GetUsers();
|
|
|
| if (!users.empty()) {
|
| UserList::const_iterator it = users.begin();
|
| @@ -1372,7 +1372,7 @@ CommandLine* WallpaperManager::GetCommandLine() {
|
| }
|
|
|
| void WallpaperManager::InitializeRegisteredDeviceWallpaper() {
|
| - if (UserManager::Get()->IsUserLoggedIn())
|
| + if (GetUserManager()->IsUserLoggedIn())
|
| return;
|
|
|
| bool disable_boot_animation =
|
| @@ -1382,7 +1382,7 @@ void WallpaperManager::InitializeRegisteredDeviceWallpaper() {
|
| kAccountsPrefShowUserNamesOnSignIn, &show_users);
|
| DCHECK(result) << "Unable to fetch setting "
|
| << kAccountsPrefShowUserNamesOnSignIn;
|
| - const chromeos::UserList& users = UserManager::Get()->GetUsers();
|
| + const chromeos::UserList& users = GetUserManager()->GetUsers();
|
| int public_session_user_index = FindPublicSession(users);
|
| if ((!show_users && public_session_user_index == -1) || users.empty()) {
|
| // Boot into sign in form, preload default wallpaper.
|
| @@ -1466,7 +1466,7 @@ bool WallpaperManager::GetUserWallpaperInfo(const std::string& user_id,
|
| WallpaperInfo* info) const {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| - if (UserManager::Get()->IsUserNonCryptohomeDataEphemeral(user_id)) {
|
| + if (GetUserManager()->IsUserNonCryptohomeDataEphemeral(user_id)) {
|
| // Default to the values cached in memory.
|
| *info = current_user_wallpaper_info_;
|
|
|
| @@ -1518,13 +1518,13 @@ void WallpaperManager::MoveCustomWallpapersSuccess(
|
| base::FilePath(user_id_hash).Append(info.file).value();
|
| info.file = relative_path;
|
| bool is_persistent =
|
| - !UserManager::Get()->IsUserNonCryptohomeDataEphemeral(user_id);
|
| + !GetUserManager()->IsUserNonCryptohomeDataEphemeral(user_id);
|
| SetUserWallpaperInfo(user_id, info, is_persistent);
|
| }
|
| }
|
|
|
| void WallpaperManager::MoveLoggedInUserCustomWallpaper() {
|
| - const User* logged_in_user = UserManager::Get()->GetLoggedInUser();
|
| + const User* logged_in_user = GetUserManager()->GetLoggedInUser();
|
| task_runner_->PostTask(
|
| FROM_HERE,
|
| base::Bind(&WallpaperManager::MoveCustomWallpapersOnWorker,
|
|
|