Chromium Code Reviews| 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 86671e94f8e5cff749e87522245ed1c8af4baa96..a36479e39e1b49d83bf6e164b6e6c9d9cac2ad4f 100644 |
| --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
| +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
| @@ -19,6 +19,7 @@ |
| #include "base/threading/sequenced_worker_pool.h" |
| #include "base/threading/worker_pool.h" |
| #include "chrome/browser/browser_process.h" |
| +#include "chrome/browser/chromeos/login/user.h" |
| #include "chrome/browser/chromeos/login/user_image.h" |
| #include "chrome/browser/chromeos/login/user_manager.h" |
| #include "chrome/browser/chromeos/login/wallpaper_manager.h" |
| @@ -182,18 +183,14 @@ bool WallpaperPrivateGetStringsFunction::RunImpl() { |
| dict->SetString(id, l10n_util::GetStringUTF16(idr)) |
| SET_STRING("webFontFamily", IDS_WEB_FONT_FAMILY); |
| SET_STRING("webFontSize", IDS_WEB_FONT_SIZE); |
| - SET_STRING("searchTextLabel", IDS_WALLPAPER_MANAGER_SEARCH_TEXT_LABEL); |
| SET_STRING("allCategoryLabel", IDS_WALLPAPER_MANAGER_ALL_CATEGORY_LABEL); |
| + SET_STRING("deleteCommandLabel", IDS_WALLPAPER_MANAGER_DELETE_COMMAND_LABEL); |
| SET_STRING("customCategoryLabel", |
| IDS_WALLPAPER_MANAGER_CUSTOM_CATEGORY_LABEL); |
| SET_STRING("selectCustomLabel", |
| IDS_WALLPAPER_MANAGER_SELECT_CUSTOM_LABEL); |
| SET_STRING("positionLabel", IDS_WALLPAPER_MANAGER_POSITION_LABEL); |
| SET_STRING("colorLabel", IDS_WALLPAPER_MANAGER_COLOR_LABEL); |
| - SET_STRING("previewLabel", IDS_WALLPAPER_MANAGER_PREVIEW_LABEL); |
| - SET_STRING("downloadingLabel", IDS_WALLPAPER_MANAGER_DOWNLOADING_LABEL); |
| - SET_STRING("setWallpaperDaily", IDS_OPTIONS_SET_WALLPAPER_DAILY); |
| - SET_STRING("searchTextLabel", IDS_WALLPAPER_MANAGER_SEARCH_TEXT_LABEL); |
| SET_STRING("centerCroppedLayout", |
| IDS_OPTIONS_WALLPAPER_CENTER_CROPPED_LAYOUT); |
| SET_STRING("centerLayout", IDS_OPTIONS_WALLPAPER_CENTER_LAYOUT); |
| @@ -509,6 +506,33 @@ void WallpaperPrivateSetWallpaperFunction::SetDecodedWallpaper( |
| SendResponse(true); |
| } |
| +WallpaperPrivateResetWallpaperFunction:: |
| + WallpaperPrivateResetWallpaperFunction() {} |
| + |
| +WallpaperPrivateResetWallpaperFunction:: |
| + ~WallpaperPrivateResetWallpaperFunction() {} |
| + |
| +bool WallpaperPrivateResetWallpaperFunction::RunImpl() { |
| + chromeos::WallpaperManager* wallpaper_manager = |
| + chromeos::WallpaperManager::Get(); |
| + chromeos::UserManager* user_manager = chromeos::UserManager::Get(); |
| + |
| + std::string email = user_manager->GetLoggedInUser()->email(); |
| + wallpaper_manager->RemoveUserWallpaperInfo(email); |
|
miket_OOO
2013/03/21 16:58:30
Could this parameter be const?
bshe
2013/03/22 15:11:57
Sorry. You mean the parameter of RemoveUserWallpap
|
| + |
| + chromeos::WallpaperInfo info = { |
| + "", |
| + ash::WALLPAPER_LAYOUT_CENTER, |
| + chromeos::User::DEFAULT, |
| + base::Time::Now().LocalMidnight() |
| + }; |
| + bool is_persistent = |
| + !user_manager->IsCurrentUserNonCryptohomeDataEphemeral(); |
| + wallpaper_manager->SetUserWallpaperInfo(email, info, is_persistent); |
| + wallpaper_manager->SetDefaultWallpaper(); |
| + return true; |
| +} |
| + |
| WallpaperPrivateSetCustomWallpaperFunction:: |
| WallpaperPrivateSetCustomWallpaperFunction() {} |