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

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

Issue 1631923004: Sync 3rd party wallpaper app name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « no previous file | chrome/browser/profiles/profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698