-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Share prefs between Tor profile and its parent profile.
- Loading branch information
Showing
5 changed files
with
101 additions
and
10 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
chromium_src/chrome/browser/content_settings/host_content_settings_map_factory.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,9 @@ | ||
/* 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/profiles/profile_util.h" | ||
|
||
#define BRAVE_BUILD_SERVICE_INSTANCE_FOR brave::IsSessionProfile(profile) || | ||
#include "../../../../../chrome/browser/content_settings/host_content_settings_map_factory.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
16 changes: 16 additions & 0 deletions
16
chromium_src/chrome/browser/supervised_user/supervised_user_settings_service_factory.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,16 @@ | ||
/* 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 https://mozilla.org/MPL/2.0/. */ | ||
|
||
#include "brave/browser/profiles/profile_util.h" | ||
|
||
// Use the same SupervisedUserSettingsService, which handles a part of | ||
// preferences, as its parent profile. Chromium's incognito profile also shares | ||
// it with its original profile. | ||
#define BRAVE_GET_KEY_TO_USE \ | ||
if (brave::IsSessionProfilePath(key->GetPath())) { \ | ||
return brave::GetParentProfile(key->GetPath())->GetProfileKey(); \ | ||
} | ||
|
||
#include "../../../../../chrome/browser/supervised_user/supervised_user_settings_service_factory.cc" |
12 changes: 12 additions & 0 deletions
12
patches/chrome-browser-content_settings-host_content_settings_map_factory.cc.patch
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,12 @@ | ||
diff --git a/chrome/browser/content_settings/host_content_settings_map_factory.cc b/chrome/browser/content_settings/host_content_settings_map_factory.cc | ||
index a3797e6705b879e917c33bc907ce6482c5c10c68..0d2c8792432e1dfeb80511d9ff54d8df9cd06519 100644 | ||
--- a/chrome/browser/content_settings/host_content_settings_map_factory.cc | ||
+++ b/chrome/browser/content_settings/host_content_settings_map_factory.cc | ||
@@ -80,6 +80,7 @@ scoped_refptr<RefcountedKeyedService> | ||
|
||
scoped_refptr<HostContentSettingsMap> settings_map(new HostContentSettingsMap( | ||
profile->GetPrefs(), | ||
+ BRAVE_BUILD_SERVICE_INSTANCE_FOR | ||
profile->IsIncognitoProfile() || profile->IsGuestSession(), | ||
/*store_last_modified=*/true, | ||
base::FeatureList::IsEnabled(features::kPermissionDelegation))); |
12 changes: 12 additions & 0 deletions
12
patches/chrome-browser-supervised_user-supervised_user_settings_service_factory.cc.patch
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,12 @@ | ||
diff --git a/chrome/browser/supervised_user/supervised_user_settings_service_factory.cc b/chrome/browser/supervised_user/supervised_user_settings_service_factory.cc | ||
index 5f85a90f2f2800c00bf0367c1de83ff36d8b8fe7..9ab88b8a25b36afdbe3016fd20cc29343395e634 100644 | ||
--- a/chrome/browser/supervised_user/supervised_user_settings_service_factory.cc | ||
+++ b/chrome/browser/supervised_user/supervised_user_settings_service_factory.cc | ||
@@ -36,6 +36,7 @@ SupervisedUserSettingsServiceFactory::BuildServiceInstanceFor( | ||
|
||
SimpleFactoryKey* SupervisedUserSettingsServiceFactory::GetKeyToUse( | ||
SimpleFactoryKey* key) const { | ||
+ BRAVE_GET_KEY_TO_USE | ||
ProfileKey* profile_key = ProfileKey::FromSimpleFactoryKey(key); | ||
return profile_key->GetOriginalKey(); | ||
} |