Index: chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
index a9b181a72fa2f2e77a6a8f3a78b02484e96b832d..045fa11261dce2feb83207512726e3c0adfe3fd1 100644 |
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
@@ -22,7 +22,6 @@ |
#include "base/strings/stringprintf.h" |
#include "base/threading/worker_pool.h" |
#include "chrome/browser/browser_process.h" |
-#include "chrome/browser/chromeos/login/users/user_manager.h" |
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_paths.h" |
@@ -30,6 +29,7 @@ |
#include "chrome/grit/generated_resources.h" |
#include "chrome/grit/platform_locale_settings.h" |
#include "components/user_manager/user.h" |
+#include "components/user_manager/user_manager.h" |
#include "content/public/browser/browser_thread.h" |
#include "extensions/browser/event_router.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -301,7 +301,7 @@ bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() { |
params = set_wallpaper_if_exists::Params::Create(*args_); |
EXTENSION_FUNCTION_VALIDATE(params); |
- user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email(); |
base::FilePath wallpaper_path; |
base::FilePath fallback_path; |
@@ -372,11 +372,11 @@ void WallpaperPrivateSetWallpaperIfExistsFunction::OnWallpaperDecoded( |
wallpaper_private::ToString(params->layout)); |
bool update_wallpaper = |
- user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
wallpaper_manager->SetWallpaperFromImageSkia( |
user_id_, image, layout, update_wallpaper); |
- bool is_persistent = |
- !chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral(); |
+ bool is_persistent = !user_manager::UserManager::Get() |
+ ->IsCurrentUserNonCryptohomeDataEphemeral(); |
chromeos::WallpaperInfo info = {params->url, layout, |
user_manager::User::ONLINE, |
base::Time::Now().LocalMidnight()}; |
@@ -408,7 +408,7 @@ bool WallpaperPrivateSetWallpaperFunction::RunAsync() { |
EXTENSION_FUNCTION_VALIDATE(params); |
// Gets email address while at UI thread. |
- user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email(); |
StartDecode(params->wallpaper); |
@@ -482,12 +482,12 @@ void WallpaperPrivateSetWallpaperFunction::SetDecodedWallpaper( |
wallpaper_private::ToString(params->layout)); |
bool update_wallpaper = |
- user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
wallpaper_manager->SetWallpaperFromImageSkia( |
user_id_, *image.get(), layout, update_wallpaper); |
- bool is_persistent = |
- !chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral(); |
+ bool is_persistent = !user_manager::UserManager::Get() |
+ ->IsCurrentUserNonCryptohomeDataEphemeral(); |
chromeos::WallpaperInfo info = {params->url, layout, |
user_manager::User::ONLINE, |
base::Time::Now().LocalMidnight()}; |
@@ -510,7 +510,7 @@ WallpaperPrivateResetWallpaperFunction:: |
bool WallpaperPrivateResetWallpaperFunction::RunAsync() { |
chromeos::WallpaperManager* wallpaper_manager = |
chromeos::WallpaperManager::Get(); |
- chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
+ user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
std::string user_id = user_manager->GetActiveUser()->email(); |
wallpaper_manager->RemoveUserWallpaperInfo(user_id); |
@@ -544,9 +544,9 @@ bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() { |
EXTENSION_FUNCTION_VALIDATE(params); |
// Gets email address and username hash while at UI thread. |
- user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ = user_manager::UserManager::Get()->GetActiveUser()->email(); |
user_id_hash_ = |
- chromeos::UserManager::Get()->GetActiveUser()->username_hash(); |
+ user_manager::UserManager::Get()->GetActiveUser()->username_hash(); |
StartDecode(params->wallpaper); |
@@ -571,7 +571,7 @@ void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded( |
wallpaper_private::ToString(params->layout)); |
bool update_wallpaper = |
- user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
wallpaper_manager->SetCustomWallpaper(user_id_, |
user_id_hash_, |
params->file_name, |
@@ -655,9 +655,10 @@ bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunAsync() { |
info.layout = wallpaper_api_util::GetLayoutEnum( |
wallpaper_private::ToString(params->layout)); |
- std::string email = chromeos::UserManager::Get()->GetActiveUser()->email(); |
- bool is_persistent = |
- !chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral(); |
+ std::string email = |
+ user_manager::UserManager::Get()->GetActiveUser()->email(); |
+ bool is_persistent = !user_manager::UserManager::Get() |
+ ->IsCurrentUserNonCryptohomeDataEphemeral(); |
wallpaper_manager->SetUserWallpaperInfo(email, info, is_persistent); |
wallpaper_manager->UpdateWallpaper(false /* clear_cache */); |
SendResponse(true); |
@@ -676,7 +677,7 @@ WallpaperPrivateMinimizeInactiveWindowsFunction:: |
bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync() { |
WindowStateManager::MinimizeInactiveWindows( |
- chromeos::UserManager::Get()->GetActiveUser()->username_hash()); |
+ user_manager::UserManager::Get()->GetActiveUser()->username_hash()); |
return true; |
} |
@@ -690,7 +691,7 @@ WallpaperPrivateRestoreMinimizedWindowsFunction:: |
bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync() { |
WindowStateManager::RestoreWindows( |
- chromeos::UserManager::Get()->GetActiveUser()->username_hash()); |
+ user_manager::UserManager::Get()->GetActiveUser()->username_hash()); |
return true; |
} |
@@ -706,7 +707,8 @@ bool WallpaperPrivateGetThumbnailFunction::RunAsync() { |
EXTENSION_FUNCTION_VALIDATE(params); |
base::FilePath thumbnail_path; |
- std::string email = chromeos::UserManager::Get()->GetActiveUser()->email(); |
+ std::string email = |
+ user_manager::UserManager::Get()->GetActiveUser()->email(); |
if (params->source == get_thumbnail::Params::SOURCE_ONLINE) { |
std::string file_name = GURL(params->url_or_file).ExtractFileName(); |
CHECK(PathService::Get(chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS, |