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 cce297f29283114f187bf89dac4fa7a202fb5d0c..73b31a50c927d73666aa7d9df8af104cef57b5a4 100644 |
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
@@ -35,6 +35,7 @@ |
#include "chrome/grit/generated_resources.h" |
#include "chromeos/chromeos_switches.h" |
#include "components/user_manager/user.h" |
+#include "components/user_manager/user_id.h" |
#include "components/user_manager/user_manager.h" |
#include "components/wallpaper/wallpaper_layout.h" |
#include "content/public/browser/browser_thread.h" |
@@ -340,7 +341,7 @@ bool WallpaperPrivateGetSyncSettingFunction::RunSync() { |
} |
WallpaperPrivateSetWallpaperIfExistsFunction:: |
- WallpaperPrivateSetWallpaperIfExistsFunction() {} |
+ WallpaperPrivateSetWallpaperIfExistsFunction() : user_id_(std::string(), std::string()) {} |
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:45
EmptyUserID() ?
|
WallpaperPrivateSetWallpaperIfExistsFunction:: |
~WallpaperPrivateSetWallpaperIfExistsFunction() {} |
@@ -349,9 +350,9 @@ bool WallpaperPrivateSetWallpaperIfExistsFunction::RunAsync() { |
params = set_wallpaper_if_exists::Params::Create(*args_); |
EXTENSION_FUNCTION_VALIDATE(params); |
- // Gets email address from caller, ensuring multiprofile compatibility. |
+ // Gets User ID from caller, ensuring multiprofile compatibility. |
const user_manager::User* user = GetUserFromBrowserContext(browser_context()); |
- user_id_ = user->email(); |
+ user_id_ = user->GetUserID(); |
base::FilePath wallpaper_path; |
base::FilePath fallback_path; |
@@ -424,7 +425,7 @@ void WallpaperPrivateSetWallpaperIfExistsFunction::OnWallpaperDecoded( |
wallpaper_base::ToString(params->layout)); |
bool update_wallpaper = |
- user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ == user_manager::UserManager::Get()->GetActiveUser()->GetUserID(); |
wallpaper_manager->SetWallpaperFromImageSkia( |
user_id_, image, layout, update_wallpaper); |
bool is_persistent = !user_manager::UserManager::Get() |
@@ -450,7 +451,7 @@ void WallpaperPrivateSetWallpaperIfExistsFunction::OnFileNotExists( |
OnFailure(error); |
} |
-WallpaperPrivateSetWallpaperFunction::WallpaperPrivateSetWallpaperFunction() { |
+WallpaperPrivateSetWallpaperFunction::WallpaperPrivateSetWallpaperFunction() : user_id_(std::string(), std::string()) { |
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:46
EmptyUserID() ?
|
} |
WallpaperPrivateSetWallpaperFunction::~WallpaperPrivateSetWallpaperFunction() { |
@@ -460,9 +461,9 @@ bool WallpaperPrivateSetWallpaperFunction::RunAsync() { |
params = set_wallpaper::Params::Create(*args_); |
EXTENSION_FUNCTION_VALIDATE(params); |
- // Gets email address from caller, ensuring multiprofile compatibility. |
+ // Gets user ID address from caller, ensuring multiprofile compatibility. |
const user_manager::User* user = GetUserFromBrowserContext(browser_context()); |
- user_id_ = user->email(); |
+ user_id_ = user->GetUserID(); |
StartDecode(params->wallpaper); |
@@ -534,7 +535,7 @@ void WallpaperPrivateSetWallpaperFunction::SetDecodedWallpaper( |
wallpaper_base::ToString(params->layout)); |
bool update_wallpaper = |
- user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ == user_manager::UserManager::Get()->GetActiveUser()->GetUserID(); |
wallpaper_manager->SetWallpaperFromImageSkia( |
user_id_, *image.get(), layout, update_wallpaper); |
@@ -565,7 +566,7 @@ bool WallpaperPrivateResetWallpaperFunction::RunAsync() { |
chromeos::WallpaperManager::Get(); |
user_manager::UserManager* user_manager = user_manager::UserManager::Get(); |
- std::string user_id = user_manager->GetActiveUser()->email(); |
+ user_manager::UserID user_id = user_manager->GetActiveUser()->GetUserID(); |
wallpaper_manager->RemoveUserWallpaperInfo(user_id); |
wallpaper::WallpaperInfo info = {std::string(), |
@@ -587,7 +588,7 @@ bool WallpaperPrivateResetWallpaperFunction::RunAsync() { |
} |
WallpaperPrivateSetCustomWallpaperFunction:: |
- WallpaperPrivateSetCustomWallpaperFunction() {} |
+ WallpaperPrivateSetCustomWallpaperFunction() : user_id_(std::string(), std::string()) {} |
Denis Kuznetsov (DE-MUC)
2015/06/10 16:50:45
EmptyUserID() ?
|
WallpaperPrivateSetCustomWallpaperFunction:: |
~WallpaperPrivateSetCustomWallpaperFunction() {} |
@@ -596,9 +597,9 @@ bool WallpaperPrivateSetCustomWallpaperFunction::RunAsync() { |
params = set_custom_wallpaper::Params::Create(*args_); |
EXTENSION_FUNCTION_VALIDATE(params); |
- // Gets email address from caller, ensuring multiprofile compatibility. |
+ // Gets User ID from caller, ensuring multiprofile compatibility. |
const user_manager::User* user = GetUserFromBrowserContext(browser_context()); |
- user_id_ = user->email(); |
+ user_id_ = user->GetUserID(); |
user_id_hash_ = user->username_hash(); |
StartDecode(params->wallpaper); |
@@ -624,7 +625,7 @@ void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded( |
wallpaper_base::ToString(params->layout)); |
bool update_wallpaper = |
- user_id_ == user_manager::UserManager::Get()->GetActiveUser()->email(); |
+ user_id_ == user_manager::UserManager::Get()->GetActiveUser()->GetUserID(); |
wallpaper_manager->SetCustomWallpaper(user_id_, |
user_id_hash_, |
params->file_name, |
@@ -705,11 +706,11 @@ bool WallpaperPrivateSetCustomWallpaperLayoutFunction::RunAsync() { |
info.layout = wallpaper_api_util::GetLayoutEnum( |
wallpaper_base::ToString(params->layout)); |
- std::string email = |
- user_manager::UserManager::Get()->GetActiveUser()->email(); |
+ const user_manager::UserID user_id = |
+ user_manager::UserManager::Get()->GetActiveUser()->GetUserID(); |
bool is_persistent = !user_manager::UserManager::Get() |
->IsCurrentUserNonCryptohomeDataEphemeral(); |
- wallpaper_manager->SetUserWallpaperInfo(email, info, is_persistent); |
+ wallpaper_manager->SetUserWallpaperInfo(user_id, info, is_persistent); |
wallpaper_manager->UpdateWallpaper(false /* clear_cache */); |
SendResponse(true); |
@@ -757,8 +758,6 @@ bool WallpaperPrivateGetThumbnailFunction::RunAsync() { |
EXTENSION_FUNCTION_VALIDATE(params); |
base::FilePath thumbnail_path; |
- std::string email = |
- user_manager::UserManager::Get()->GetActiveUser()->email(); |
if (params->source == wallpaper_private::WALLPAPER_SOURCE_ONLINE) { |
std::string file_name = GURL(params->url_or_file).ExtractFileName(); |
CHECK(PathService::Get(chrome::DIR_CHROMEOS_WALLPAPER_THUMBNAILS, |