Skip to content

Commit

Permalink
Register brave_sync pref with chromium sync
Browse files Browse the repository at this point in the history
  • Loading branch information
darkdh committed Aug 15, 2019
1 parent 5fa736a commit 52a156b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
4 changes: 0 additions & 4 deletions browser/brave_profile_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "brave/common/pref_names.h"
#include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h"
#include "brave/components/brave_webtorrent/browser/buildflags/buildflags.h"
#include "brave/components/brave_sync/brave_sync_prefs.h"
#include "chrome/browser/net/prediction_options.h"
#include "chrome/browser/prefs/session_startup_pref.h"
#include "chrome/common/pref_names.h"
Expand Down Expand Up @@ -45,9 +44,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
registry->RegisterBooleanPref(kLocationBarIsWide, false);
registry->RegisterBooleanPref(kHideBraveRewardsButton, false);

//TODO(darkdh): merge into upstream SyncPrefs
brave_sync::prefs::Prefs::RegisterProfilePrefs(registry);

registry->RegisterBooleanPref(kWidevineOptedIn, false);
registry->RegisterBooleanPref(kAskWidevineInstall, true);
#if BUILDFLAG(BUNDLE_WIDEVINE_CDM)
Expand Down
2 changes: 2 additions & 0 deletions chromium_src/components/sync/base/sync_prefs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include "brave/components/brave_sync/brave_sync_prefs.h"
#include "../../../../components/sync/base/sync_prefs.cc"
2 changes: 0 additions & 2 deletions components/brave_sync/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "base/files/file_util.h"
#include "base/strings/utf_string_conversions.h"
#include "brave/components/brave_sync/brave_sync_prefs.h"
#include "brave/components/brave_sync/tools.h"
#include "brave/components/brave_sync/values_conv.h"
#include "chrome/browser/prefs/browser_prefs.h"
Expand All @@ -32,7 +31,6 @@ std::unique_ptr<Profile> CreateBraveSyncProfile(const base::FilePath& path) {
std::unique_ptr<sync_preferences::PrefServiceSyncable> prefs(
factory.CreateSyncable(registry.get()));
RegisterUserProfilePrefs(registry.get());
prefs::Prefs::RegisterProfilePrefs(registry.get());

TestingProfile::Builder profile_builder;
profile_builder.SetPrefService(std::move(prefs));
Expand Down
12 changes: 12 additions & 0 deletions patches/components-sync-base-sync_prefs.cc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/components/sync/base/sync_prefs.cc b/components/sync/base/sync_prefs.cc
index e0233e2c1fe41e7aca1514321881a9defe99e11f..8331c1add5cbc209023cfb938b11ef8c564e2b90 100644
--- a/components/sync/base/sync_prefs.cc
+++ b/components/sync/base/sync_prefs.cc
@@ -186,6 +186,7 @@ void SyncPrefs::RegisterProfilePrefs(
#if defined(OS_CHROMEOS)
registry->RegisterStringPref(kSyncSpareBootstrapToken, "");
#endif
+ brave_sync::prefs::Prefs::RegisterProfilePrefs(registry);
}

void SyncPrefs::AddSyncPrefObserver(SyncPrefObserver* sync_pref_observer) {

0 comments on commit 52a156b

Please sign in to comment.