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

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

Issue 676403002: Sync wallpaper based on sync themes setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_private_api.cc
diff --git a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
index 85270aead73d2ab43d0e2fa4c2469f5839dceac0..1c9d20182f8f88a32a7b24451499f41af8859d6d 100644
--- a/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
+++ b/chrome/browser/chromeos/extensions/wallpaper_private_api.cc
@@ -24,6 +24,8 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h"
@@ -292,6 +294,17 @@ bool WallpaperPrivateGetStringsFunction::RunSync() {
return true;
}
+bool WallpaperPrivateGetSyncSettingFunction::RunSync() {
+ Profile* profile = Profile::FromBrowserContext(browser_context());
+ ProfileSyncService* sync =
+ ProfileSyncServiceFactory::GetInstance()->GetForProfile(profile);
+ base::DictionaryValue* dict = new base::DictionaryValue();
+ SetResult(dict);
+ dict->SetBoolean("syncThemes",
+ sync->GetActiveDataTypes().Has(syncer::THEMES));
+ return true;
+}
+
WallpaperPrivateSetWallpaperIfExistsFunction::
WallpaperPrivateSetWallpaperIfExistsFunction() {}

Powered by Google App Engine
This is Rietveld 408576698