| Index: chrome/browser/prefs/pref_service_syncable_util.cc
|
| diff --git a/chrome/browser/prefs/pref_service_syncable_util.cc b/chrome/browser/prefs/pref_service_syncable_util.cc
|
| index e3b099cbc1bd585ba8046f26c1960cf232f68cc1..5871af23beff0744695585b8cfbd994e1f8ae6b2 100644
|
| --- a/chrome/browser/prefs/pref_service_syncable_util.cc
|
| +++ b/chrome/browser/prefs/pref_service_syncable_util.cc
|
| @@ -4,8 +4,17 @@
|
|
|
| #include "chrome/browser/prefs/pref_service_syncable_util.h"
|
|
|
| +#include <vector>
|
| +
|
| +#include "base/logging.h"
|
| +#include "build/build_config.h"
|
| #include "chrome/browser/prefs/pref_service_syncable.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/common/pref_names.h"
|
| +
|
| +#if defined(OS_ANDROID) || defined(OS_IOS)
|
| +#include "components/proxy_config/proxy_config_pref_names.h"
|
| +#endif
|
|
|
| PrefServiceSyncable* PrefServiceSyncableFromProfile(Profile* profile) {
|
| return static_cast<PrefServiceSyncable*>(profile->GetPrefs());
|
| @@ -14,3 +23,19 @@ PrefServiceSyncable* PrefServiceSyncableFromProfile(Profile* profile) {
|
| PrefServiceSyncable* PrefServiceSyncableIncognitoFromProfile(Profile* profile) {
|
| return static_cast<PrefServiceSyncable*>(profile->GetOffTheRecordPrefs());
|
| }
|
| +
|
| +PrefServiceSyncable* CreateIncognitoPrefServiceSyncable(
|
| + PrefServiceSyncable* pref_service,
|
| + PrefStore* incognito_extension_prefs) {
|
| + // List of keys that cannot be changed in the user prefs file by the incognito
|
| + // profile. All preferences that store information about the browsing history
|
| + // or behavior of the user should have this property.
|
| + std::vector<const char*> overlay_pref_names;
|
| + overlay_pref_names.push_back(prefs::kBrowserWindowPlacement);
|
| + overlay_pref_names.push_back(prefs::kSaveFileDefaultDirectory);
|
| +#if defined(OS_ANDROID) || defined(OS_IOS)
|
| + overlay_pref_names.push_back(proxy_config::prefs::kProxy);
|
| +#endif
|
| + return pref_service->CreateIncognitoPrefService(incognito_extension_prefs,
|
| + overlay_pref_names);
|
| +}
|
|
|