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 9da0e4275e618a1a9d88f71a9d5c53e8f3d727d7..6350a7f746afe9ae546da7a1e1263294071ec384 100644 |
| --- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
| +++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc |
| @@ -68,6 +68,10 @@ const char kWallpaperManifestBaseURL[] = |
| "https://storage.googleapis.com/chromeos-wallpaper-public/manifest_"; |
| #endif |
| +// Keep this value the same with the corresponding constant defined in |
| +// chrome/browser/resources/chromeos/wallpaper_manager/js/constants.js. |
| +const char kThirdPartyWallpaperPrefix[] = "third_party_"; |
| + |
| bool IsOEMDefaultWallpaper() { |
| return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| chromeos::switches::kDefaultWallpaperIsOem); |
| @@ -634,11 +638,13 @@ void WallpaperPrivateSetCustomWallpaperFunction::OnWallpaperDecoded( |
| unsafe_wallpaper_decoder_ = NULL; |
| Profile* profile = Profile::FromBrowserContext(browser_context()); |
| - // This API is only available to the component wallpaper picker. We do not |
| - // need to show the app's name if it is the component wallpaper picker. So set |
| - // the pref to empty string. |
| - profile->GetPrefs()->SetString(prefs::kCurrentWallpaperAppName, |
| - std::string()); |
| + // This API is only available to the component wallpaper picker. It can be |
| + // called to set a custom wallpaper or sync a third party wallpaper. We need |
| + // to set the pref according to different types of wallpapers. |
|
tbarzic
2016/01/26 01:20:44
I assume this prefs should be set by third-party a
xdai1
2016/01/26 17:57:48
Currently the 3rd party wallpaper syncing scenario
tbarzic
2016/01/26 18:57:26
Yep, I assumed as much. What I'd like is for the c
|
| + if (params->file_name.find(kThirdPartyWallpaperPrefix) == std::string::npos) { |
|
tbarzic
2016/01/26 01:20:44
Can this logic be moved to wallpaper app?
E.g. add
xdai1
2016/01/26 17:57:48
Yes, it can be moved to wallpaper app by introduci
tbarzic
2016/01/26 18:57:26
Yes, but I would prefer not to leak file name form
|
| + profile->GetPrefs()->SetString(prefs::kCurrentWallpaperAppName, |
| + std::string()); |
| + } |
| if (params->generate_thumbnail) { |
| image.EnsureRepsForSupportedScales(); |