commit | c74fe491bc11f31e106f1db2c606eb6cac4abba2 | [log] [tgz] |
---|---|---|
author | Simon Zünd <[email protected]> | Thu Dec 12 17:03:16 2024 |
committer | Chromium LUCI CQ <[email protected]> | Thu Dec 12 17:03:16 2024 |
tree | d80d4b41894e2af5a858ab30c58c6545376dad4c | |
parent | 12ef81e53bbcdfea44a72aab0a90262fe411cfb2 [diff] [blame] |
[prefs] Add CreateAutomationPrefService for browser automation This CL adds a variant of CreateIncognitoPrefServiceSyncable intended for OTR profiles created via browser automation (the CDP method "Target.createBrowserContext"). Some browser UI, DevTools in particular, can be automated via CDP. Syncing preferences across CDP created browser contexts defeats their purpose. Change-Id: Ibcd5542d8515831621b5866b160ea505a815030d Fixed: 382623724 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6086128 Reviewed-by: Mihai Sardarescu <[email protected]> Commit-Queue: Simon Zünd <[email protected]> Code-Coverage: [email protected] <[email protected]> Reviewed-by: Dominic Battré <[email protected]> Cr-Commit-Position: refs/heads/main@{#1395452}
diff --git a/chrome/browser/prefs/pref_service_syncable_util.cc b/chrome/browser/prefs/pref_service_syncable_util.cc index 8c89312..9efa136e4 100644 --- a/chrome/browser/prefs/pref_service_syncable_util.cc +++ b/chrome/browser/prefs/pref_service_syncable_util.cc
@@ -25,3 +25,10 @@ incognito_extension_pref_store, prefs::GetIncognitoPersistentPrefsAllowlist()); } + +std::unique_ptr<sync_preferences::PrefServiceSyncable> +CreateAutomationPrefService(sync_preferences::PrefServiceSyncable* pref_service, + PrefStore* incognito_extension_pref_store) { + return pref_service->CreateIncognitoPrefService( + incognito_extension_pref_store, /* persistent_pref_names */ {}); +}