Skip to content

Commit

Permalink
Merge pull request #30 from brave/profile-prefs
Browse files Browse the repository at this point in the history
One RegisterProfilePrefs to rule them all
  • Loading branch information
bbondy committed Feb 8, 2018
2 parents 0d540cc + c07c6ec commit 5f55539
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 3 deletions.
2 changes: 2 additions & 0 deletions browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ source_set("browser_process") {
"brave_browser_process_impl.h",
"brave_tab_helpers.cc",
"brave_tab_helpers.h",
"brave_profile_prefs.cc",
"brave_profile_prefs.h"
]

deps = [
Expand Down
19 changes: 19 additions & 0 deletions browser/brave_profile_prefs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "brave/browser/brave_profile_prefs.h"

#include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h"
#include "components/pref_registry/pref_registry_syncable.h"


namespace brave {

void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
brave_shields::BraveShieldsWebContentsObserver::RegisterProfilePrefs(registry);
}

} // namespace brave


18 changes: 18 additions & 0 deletions browser/brave_profile_prefs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef BRAVE_BROWSER_BRAVE_BRAVE_PROFILE_PREFS_H_
#define BRAVE_BROWSER_BRAVE_BRAVE_PROFILE_PREFS_H_

namespace user_prefs {
class PrefRegistrySyncable;
}

namespace brave {

void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);

} // namespace brave

#endif // BRAVE_BROWSER_BRAVE_BRAVE_PROFILE_PREFS_H_
6 changes: 3 additions & 3 deletions patches/chrome-browser-prefs-browser_prefs.cc.patch
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 90b5ed12f2785e73700866e8027f99849f030129..de023f0485e6c472f935f6c75869684172e2942b 100644
index 90b5ed12f2785e73700866e8027f99849f030129..187009cd17f7b3f8f3b00e50638f8c5151837091 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -8,6 +8,7 @@

#include "base/metrics/histogram_macros.h"
#include "base/trace_event/trace_event.h"
+#include "brave/components/brave_shields/browser/brave_shields_web_contents_observer.h"
+#include "brave/browser/brave_profile_prefs.h"
#include "build/build_config.h"
#include "chrome/browser/about_flags.h"
#include "chrome/browser/accessibility/invert_bubble_prefs.h"
@@ -453,6 +454,7 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
SCOPED_UMA_HISTOGRAM_TIMER("Settings.RegisterProfilePrefsTime");
// User prefs. Please keep this list alphabetized.
autofill::AutofillManager::RegisterProfilePrefs(registry);
+ brave_shields::BraveShieldsWebContentsObserver::RegisterProfilePrefs(registry);
+ brave::RegisterProfilePrefs(registry);
browsing_data::prefs::RegisterBrowserUserPrefs(registry);
certificate_transparency::CTPolicyManager::RegisterPrefs(registry);
ChromeContentBrowserClient::RegisterProfilePrefs(registry);

0 comments on commit 5f55539

Please sign in to comment.