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

Unified Diff: chrome/browser/chromeos/extensions/wallpaper_private_api.cc

Issue 375413002: Replace chromeos::UserManager::Get() with chromeos::GetUserManager(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
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 f944243b4a3bb6767f45430d605cca8ec014e81e..a384c4048b3eab5e359ca49f56133d752263db2d 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -302,7 +302,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_ = chromeos::GetUserManager()->GetActiveUser()->email();
base::FilePath wallpaper_path;
base::FilePath fallback_path;
@@ -373,11 +373,11 @@ void WallpaperPrivateSetWallpaperIfExistsFunction::OnWallpaperDecoded(
wallpaper_private::ToString(params->layout));
bool update_wallpaper =
- user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
+ user_id_ == chromeos::GetUserManager()->GetActiveUser()->email();
wallpaper_manager->SetWallpaperFromImageSkia(
user_id_, image, layout, update_wallpaper);
bool is_persistent =
- !chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral();
+ !chromeos::GetUserManager()->IsCurrentUserNonCryptohomeDataEphemeral();
chromeos::WallpaperInfo info = {
params->url,
layout,
@@ -412,7 +412,7 @@ bool WallpaperPrivateSetWallpaperFunction::RunAsync() {
EXTENSION_FUNCTION_VALIDATE(params);
// Gets email address while at UI thread.
- user_id_ = chromeos::UserManager::Get()->GetActiveUser()->email();
+ user_id_ = chromeos::GetUserManager()->GetActiveUser()->email();
StartDecode(params->wallpaper);
@@ -486,12 +486,12 @@ void WallpaperPrivateSetWallpaperFunction::SetDecodedWallpaper(
wallpaper_private::ToString(params->layout));
bool update_wallpaper =
- user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
+ user_id_ == chromeos::GetUserManager()->GetActiveUser()->email();
wallpaper_manager->SetWallpaperFromImageSkia(
user_id_, *image.get(), layout, update_wallpaper);
bool is_persistent =
- !chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral();
+ !chromeos::GetUserManager()->IsCurrentUserNonCryptohomeDataEphemeral();
chromeos::WallpaperInfo info = {
params->url,
layout,
@@ -517,7 +517,7 @@ WallpaperPrivateResetWallpaperFunction::
bool WallpaperPrivateResetWallpaperFunction::RunAsync() {
chromeos::WallpaperManager* wallpaper_manager =
chromeos::WallpaperManager::Get();
- chromeos::UserManager* user_manager = chromeos::UserManager::Get();
+ chromeos::UserManager* user_manager = chromeos::GetUserManager();
std::string user_id = user_manager->GetActiveUser()->email();
wallpaper_manager->RemoveUserWallpaperInfo(user_id);
@@ -553,9 +553,8 @@ 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_hash_ =
- chromeos::UserManager::Get()->GetActiveUser()->username_hash();
+ user_id_ = chromeos::GetUserManager()->GetActiveUser()->email();
+ user_id_hash_ = chromeos::GetUserManager()->GetActiveUser()->username_hash();
StartDecode(params->wallpaper);
@@ -580,7 +579,7 @@ void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded(
wallpaper_private::ToString(params->layout));
bool update_wallpaper =
- user_id_ == chromeos::UserManager::Get()->GetActiveUser()->email();
+ user_id_ == chromeos::GetUserManager()->GetActiveUser()->email();
wallpaper_manager->SetCustomWallpaper(user_id_,
user_id_hash_,
params->file_name,
@@ -664,9 +663,9 @@ bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunAsync() {
info.layout = wallpaper_api_util::GetLayoutEnum(
wallpaper_private::ToString(params->layout));
- std::string email = chromeos::UserManager::Get()->GetActiveUser()->email();
+ std::string email = chromeos::GetUserManager()->GetActiveUser()->email();
bool is_persistent =
- !chromeos::UserManager::Get()->IsCurrentUserNonCryptohomeDataEphemeral();
+ !chromeos::GetUserManager()->IsCurrentUserNonCryptohomeDataEphemeral();
wallpaper_manager->SetUserWallpaperInfo(email, info, is_persistent);
wallpaper_manager->UpdateWallpaper(false /* clear_cache */);
SendResponse(true);
@@ -685,7 +684,7 @@ WallpaperPrivateMinimizeInactiveWindowsFunction::
bool WallpaperPrivateMinimizeInactiveWindowsFunction::RunAsync() {
WindowStateManager::MinimizeInactiveWindows(
- chromeos::UserManager::Get()->GetActiveUser()->username_hash());
+ chromeos::GetUserManager()->GetActiveUser()->username_hash());
return true;
}
@@ -699,7 +698,7 @@ WallpaperPrivateRestoreMinimizedWindowsFunction::
bool WallpaperPrivateRestoreMinimizedWindowsFunction::RunAsync() {
WindowStateManager::RestoreWindows(
- chromeos::UserManager::Get()->GetActiveUser()->username_hash());
+ chromeos::GetUserManager()->GetActiveUser()->username_hash());
return true;
}
@@ -715,7 +714,7 @@ bool WallpaperPrivateGetThumbnailFunction::RunAsync() {
EXTENSION_FUNCTION_VALIDATE(params);
base::FilePath thumbnail_path;
- std::string email = chromeos::UserManager::Get()->GetActiveUser()->email();
+ std::string email = chromeos::GetUserManager()->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,

Powered by Google App Engine
This is Rietveld 408576698