-
Notifications
You must be signed in to change notification settings - Fork 904
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3031 from brave/reg-pref-rework
Register prefs in right places
- Loading branch information
Showing
8 changed files
with
82 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* 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/browser/brave_local_state_prefs.h" | ||
#include "../../../../chrome/browser/prefs/browser_prefs.cc" |
55 changes: 55 additions & 0 deletions
55
chromium_src/chrome/browser/profiles/pref_service_builder_utils.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* Copyright (c) 2019 The Brave Authors. All rights reserved. | ||
* 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 "chrome/browser/profiles/pref_service_builder_utils.h" | ||
|
||
#define RegisterProfilePrefs RegisterProfilePrefs_ChromiumImpl | ||
#include "../../../../../chrome/browser/profiles/pref_service_builder_utils.cc" | ||
#undef RegisterProfilePrefs | ||
|
||
#include "brave/browser/brave_profile_prefs.h" | ||
#include "brave/browser/themes/brave_theme_service.h" | ||
#include "brave/browser/tor/buildflags.h" | ||
#include "brave/common/pref_names.h" | ||
#include "brave/components/brave_rewards/browser/rewards_service.h" | ||
#include "chrome/common/pref_names.h" | ||
#include "components/spellcheck/browser/pref_names.h" | ||
|
||
#if BUILDFLAG(ENABLE_TOR) | ||
#include "brave/browser/tor/tor_profile_service.h" | ||
#endif | ||
|
||
// Prefs for KeyedService | ||
void RegisterProfilePrefs(bool is_signin_profile, | ||
const std::string& locale, | ||
user_prefs::PrefRegistrySyncable* registry) { | ||
RegisterProfilePrefs_ChromiumImpl(is_signin_profile, locale, registry); | ||
|
||
// appearance | ||
#if !defined(OS_ANDROID) | ||
BraveThemeService::RegisterProfilePrefs(registry); | ||
#endif | ||
|
||
#if BUILDFLAG(ENABLE_TOR) | ||
tor::TorProfileService::RegisterProfilePrefs(registry); | ||
#endif | ||
|
||
brave_rewards::RewardsService::RegisterProfilePrefs(registry); | ||
|
||
// Disable spell check service | ||
registry->SetDefaultPrefValue( | ||
spellcheck::prefs::kSpellCheckUseSpellingService, base::Value(false)); | ||
|
||
// Make sure sign into Brave is not enabled | ||
// The older kSigninAllowed is deprecated and only in use in Android until | ||
// C71. | ||
registry->SetDefaultPrefValue(prefs::kSigninAllowedOnNextStartup, | ||
base::Value(false)); | ||
|
||
#if defined(OS_LINUX) | ||
// Use brave theme by default instead of gtk theme. | ||
registry->SetDefaultPrefValue(prefs::kUsesSystemTheme, base::Value(false)); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters