Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1711)

Unified Diff: chrome/browser/prefs/pref_service_syncable_util.cc

Issue 1332283003: Remove dependency of PrefSyncableService on PrefsTabHelper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pref_service_syncable_util
Patch Set: Fix grammar error and rename incognito_extensions_prefs to incognito_extensions_prefs_store Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/prefs/pref_service_syncable_util.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..eac0df9b213727e2c00546322bbb833cbcc7e849 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_pref_store) {
+ // 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_pref_store, overlay_pref_names);
+}
« no previous file with comments | « chrome/browser/prefs/pref_service_syncable_util.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698