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

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

Issue 23480087: Use username_hash instead of email (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 3 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 7bf76790c3e8cdd2efd04bcd6a1130d671242b48..998dfa9888848171e6e649632e34de456e1728fa 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_api.cc
@@ -38,8 +38,10 @@ bool WallpaperSetWallpaperFunction::RunImpl() {
EXTENSION_FUNCTION_VALIDATE(!file_name_.empty());
- // Gets email address while at UI thread.
+ // Gets email address and username hash while at UI thread.
email_ = chromeos::UserManager::Get()->GetLoggedInUser()->email();
+ username_hash_ =
Nikita (slow) 2013/09/25 14:47:11 This may be empty string if multi-profiles are not
bshe 2013/09/26 16:49:57 I tested w/o --multi-profiles switch. It seems wor
+ chromeos::UserManager::Get()->GetLoggedInUser()->username_hash();
image_data_.assign(input->GetBuffer(), input->GetSize());
StartDecode(image_data_);
@@ -55,7 +57,7 @@ void WallpaperSetWallpaperFunction::OnWallpaperDecoded(
image_data_.end());
chromeos::UserImage image(wallpaper, raw_image);
base::FilePath thumbnail_path = wallpaper_manager->GetCustomWallpaperPath(
- chromeos::kThumbnailWallpaperSubDir, email_, file_name_);
+ chromeos::kThumbnailWallpaperSubDir, username_hash_, file_name_);
sequence_token_ = BrowserThread::GetBlockingPool()->
GetNamedSequenceToken(chromeos::kWallpaperSequenceTokenName);
@@ -64,10 +66,8 @@ void WallpaperSetWallpaperFunction::OnWallpaperDecoded(
GetSequencedTaskRunnerWithShutdownBehavior(sequence_token_,
base::SequencedWorkerPool::BLOCK_SHUTDOWN);
- // In the new wallpaper picker UI, we do not depend on WallpaperDelegate
- // to refresh thumbnail. Uses a null delegate here.
- wallpaper_manager->SetCustomWallpaper(email_, file_name_, layout_,
- chromeos::User::CUSTOMIZED,
+ wallpaper_manager->SetCustomWallpaper(email_, username_hash_, file_name_,
Nikita (slow) 2013/09/25 14:47:11 nit: One parameter per line please.
bshe 2013/09/26 16:49:57 Done.
+ layout_, chromeos::User::CUSTOMIZED,
image);
unsafe_wallpaper_decoder_ = NULL;

Powered by Google App Engine
This is Rietveld 408576698