| 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 7a8ec39e257a87d744ccefca615c7d6747436b1b..d880d6b1d164c6a7f3f97197de0f3423a7aa787d 100644
|
| --- a/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| +++ b/chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.cc
|
| @@ -11,9 +11,9 @@
|
|
|
| #include "ash/common/ash_constants.h"
|
| #include "ash/common/ash_switches.h"
|
| -#include "ash/desktop_background/desktop_background_controller.h"
|
| #include "ash/public/interfaces/wallpaper.mojom.h"
|
| #include "ash/shell.h"
|
| +#include "ash/wallpaper/wallpaper_controller.h"
|
| #include "base/bind.h"
|
| #include "base/bind_helpers.h"
|
| #include "base/command_line.h"
|
| @@ -109,7 +109,7 @@ base::FilePath GetCustomizedWallpaperDefaultRescaledFileName(
|
| default_downloaded_file_name.BaseName().value() + suffix);
|
| }
|
|
|
| -// Whether DesktopBackgroundController should start with customized default
|
| +// Whether WallpaperController should start with customized default
|
| // wallpaper in WallpaperManager::InitializeWallpaper() or not.
|
| bool ShouldUseCustomizedDefaultWallpaper() {
|
| PrefService* pref_service = g_browser_process->local_state();
|
| @@ -221,9 +221,8 @@ void SetWallpaper(const gfx::ImageSkia& image,
|
| }
|
| // Avoid loading unnecessary wallpapers in tests without a shell instance.
|
| if (ash::Shell::HasInstance()) {
|
| - ash::Shell::GetInstance()
|
| - ->desktop_background_controller()
|
| - ->SetWallpaperImage(image, layout);
|
| + ash::Shell::GetInstance()->wallpaper_controller()->SetWallpaperImage(
|
| + image, layout);
|
| }
|
| }
|
|
|
| @@ -405,8 +404,7 @@ void WallpaperManager::Shutdown() {
|
| WallpaperManager::WallpaperResolution
|
| WallpaperManager::GetAppropriateResolution() {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
| - gfx::Size size =
|
| - ash::DesktopBackgroundController::GetMaxDisplaySizeInNative();
|
| + gfx::Size size = ash::WallpaperController::GetMaxDisplaySizeInNative();
|
| return (size.width() > wallpaper::kSmallWallpaperMaxWidth ||
|
| size.height() > wallpaper::kSmallWallpaperMaxHeight)
|
| ? WALLPAPER_RESOLUTION_LARGE
|
| @@ -467,8 +465,7 @@ void WallpaperManager::InitializeWallpaper() {
|
| // Zero delays is also set in autotests.
|
| if (WizardController::IsZeroDelayEnabled()) {
|
| // Ensure tests have some sort of wallpaper.
|
| - ash::Shell::GetInstance()->desktop_background_controller()->
|
| - CreateEmptyWallpaper();
|
| + ash::Shell::GetInstance()->wallpaper_controller()->CreateEmptyWallpaper();
|
| return;
|
| }
|
|
|
| @@ -566,7 +563,7 @@ void WallpaperManager::SetCustomWallpaper(
|
| bool update_wallpaper) {
|
| DCHECK_CURRENTLY_ON(BrowserThread::UI);
|
|
|
| - // There is no visible background in kiosk mode.
|
| + // There is no visible wallpaper in kiosk mode.
|
| if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp())
|
| return;
|
|
|
| @@ -646,7 +643,7 @@ void WallpaperManager::SetDefaultWallpaperDelayed(const AccountId& account_id) {
|
| void WallpaperManager::DoSetDefaultWallpaper(
|
| const AccountId& account_id,
|
| MovableOnDestroyCallbackHolder on_finish) {
|
| - // There is no visible background in kiosk mode.
|
| + // There is no visible wallpaper in kiosk mode.
|
| if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp())
|
| return;
|
| wallpaper_cache_.erase(account_id);
|
| @@ -727,7 +724,7 @@ void WallpaperManager::ScheduleSetUserWallpaper(const AccountId& account_id,
|
| const user_manager::User* user =
|
| user_manager::UserManager::Get()->FindUser(account_id);
|
|
|
| - // User is unknown or there is no visible background in kiosk mode.
|
| + // User is unknown or there is no visible wallpaper in kiosk mode.
|
| if (!user || user->GetType() == user_manager::USER_TYPE_KIOSK_APP)
|
| return;
|
|
|
| @@ -807,7 +804,7 @@ void WallpaperManager::SetWallpaperFromImageSkia(
|
| bool update_wallpaper) {
|
| DCHECK(user_manager::UserManager::Get()->IsUserLoggedIn());
|
|
|
| - // There is no visible background in kiosk mode.
|
| + // There is no visible wallpaper in kiosk mode.
|
| if (user_manager::UserManager::Get()->IsLoggedInAsKioskApp())
|
| return;
|
| WallpaperInfo info;
|
| @@ -1144,8 +1141,8 @@ void WallpaperManager::SetDefaultWallpaperPath(
|
| default_small_wallpaper_file_ = default_small_wallpaper_file;
|
| default_large_wallpaper_file_ = default_large_wallpaper_file;
|
|
|
| - ash::DesktopBackgroundController* dbc =
|
| - ash::Shell::GetInstance()->desktop_background_controller();
|
| + ash::WallpaperController* controller =
|
| + ash::Shell::GetInstance()->wallpaper_controller();
|
|
|
| // |need_update_screen| is true if the previous default wallpaper is visible
|
| // now, so we need to update wallpaper on the screen.
|
| @@ -1154,9 +1151,9 @@ void WallpaperManager::SetDefaultWallpaperPath(
|
| // as a placeholder only.
|
| const bool need_update_screen =
|
| default_wallpaper_image_.get() &&
|
| - dbc->WallpaperIsAlreadyLoaded(default_wallpaper_image_->image(),
|
| - false /* compare_layouts */,
|
| - wallpaper::WALLPAPER_LAYOUT_CENTER);
|
| + controller->WallpaperIsAlreadyLoaded(default_wallpaper_image_->image(),
|
| + false /* compare_layouts */,
|
| + wallpaper::WALLPAPER_LAYOUT_CENTER);
|
|
|
| default_wallpaper_image_.reset();
|
| if (GetAppropriateResolution() == WALLPAPER_RESOLUTION_SMALL) {
|
| @@ -1173,9 +1170,8 @@ void WallpaperManager::SetDefaultWallpaperPath(
|
| }
|
| }
|
|
|
| - if (need_update_screen) {
|
| + if (need_update_screen)
|
| DoSetDefaultWallpaper(EmptyAccountId(), MovableOnDestroyCallbackHolder());
|
| - }
|
| }
|
|
|
| wallpaper::WallpaperFilesId WallpaperManager::GetFilesId(
|
|
|