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

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

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_api.cc
diff --git a/chrome/browser/chromeos/extensions/wallpaper_api.cc b/chrome/browser/chromeos/extensions/wallpaper_api.cc
index 2ae5cc168247516db2af51a6c6828e18f8d97b27..f55a911ae0c848c66e025d58e29a7d7afb826e4e 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc
@@ -93,7 +93,7 @@ base::LazyInstance<WallpaperFetcher> g_wallpaper_fetcher =
} // namespace
-WallpaperSetWallpaperFunction::WallpaperSetWallpaperFunction() {
+WallpaperSetWallpaperFunction::WallpaperSetWallpaperFunction() : user_id_(std::string(), std::string()) {
Denis Kuznetsov (DE-MUC) 2015/06/10 16:50:45 EmptyUserID() ?
}
WallpaperSetWallpaperFunction::~WallpaperSetWallpaperFunction() {
@@ -104,8 +104,8 @@ bool WallpaperSetWallpaperFunction::RunAsync() {
params_ = set_wallpaper::Params::Create(*args_);
EXTENSION_FUNCTION_VALIDATE(params_);
- // Gets email address and username hash while at UI thread.
- user_id_ = user_manager::UserManager::Get()->GetLoggedInUser()->email();
+ // Gets user id and username hash while at UI thread.
+ user_id_ = user_manager::UserManager::Get()->GetLoggedInUser()->GetUserID();
user_id_hash_ =
user_manager::UserManager::Get()->GetLoggedInUser()->username_hash();
@@ -142,7 +142,7 @@ void WallpaperSetWallpaperFunction::OnWallpaperDecoded(
wallpaper::WallpaperLayout layout = wallpaper_api_util::GetLayoutEnum(
extensions::api::wallpaper::ToString(params_->details.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_->details.filename,

Powered by Google App Engine
This is Rietveld 408576698