| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/prefs/pref_service_syncable_util.h" | 5 #include "chrome/browser/prefs/pref_service_syncable_util.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/pref_names.h" | 12 #include "chrome/common/pref_names.h" |
| 13 #include "components/syncable_prefs/pref_service_syncable.h" | 13 #include "components/sync_preferences/pref_service_syncable.h" |
| 14 | 14 |
| 15 #if defined(OS_ANDROID) | 15 #if defined(OS_ANDROID) |
| 16 #include "components/proxy_config/proxy_config_pref_names.h" | 16 #include "components/proxy_config/proxy_config_pref_names.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 syncable_prefs::PrefServiceSyncable* PrefServiceSyncableFromProfile( | 19 sync_preferences::PrefServiceSyncable* PrefServiceSyncableFromProfile( |
| 20 Profile* profile) { | 20 Profile* profile) { |
| 21 return static_cast<syncable_prefs::PrefServiceSyncable*>(profile->GetPrefs()); | 21 return static_cast<sync_preferences::PrefServiceSyncable*>( |
| 22 profile->GetPrefs()); |
| 22 } | 23 } |
| 23 | 24 |
| 24 syncable_prefs::PrefServiceSyncable* PrefServiceSyncableIncognitoFromProfile( | 25 sync_preferences::PrefServiceSyncable* PrefServiceSyncableIncognitoFromProfile( |
| 25 Profile* profile) { | 26 Profile* profile) { |
| 26 return static_cast<syncable_prefs::PrefServiceSyncable*>( | 27 return static_cast<sync_preferences::PrefServiceSyncable*>( |
| 27 profile->GetOffTheRecordPrefs()); | 28 profile->GetOffTheRecordPrefs()); |
| 28 } | 29 } |
| 29 | 30 |
| 30 syncable_prefs::PrefServiceSyncable* CreateIncognitoPrefServiceSyncable( | 31 sync_preferences::PrefServiceSyncable* CreateIncognitoPrefServiceSyncable( |
| 31 syncable_prefs::PrefServiceSyncable* pref_service, | 32 sync_preferences::PrefServiceSyncable* pref_service, |
| 32 PrefStore* incognito_extension_pref_store) { | 33 PrefStore* incognito_extension_pref_store) { |
| 33 // List of keys that cannot be changed in the user prefs file by the incognito | 34 // List of keys that cannot be changed in the user prefs file by the incognito |
| 34 // profile. All preferences that store information about the browsing history | 35 // profile. All preferences that store information about the browsing history |
| 35 // or behavior of the user should have this property. | 36 // or behavior of the user should have this property. |
| 36 std::vector<const char*> overlay_pref_names; | 37 std::vector<const char*> overlay_pref_names; |
| 37 overlay_pref_names.push_back(prefs::kBrowserWindowPlacement); | 38 overlay_pref_names.push_back(prefs::kBrowserWindowPlacement); |
| 38 overlay_pref_names.push_back(prefs::kSaveFileDefaultDirectory); | 39 overlay_pref_names.push_back(prefs::kSaveFileDefaultDirectory); |
| 39 #if defined(OS_ANDROID) | 40 #if defined(OS_ANDROID) |
| 40 overlay_pref_names.push_back(proxy_config::prefs::kProxy); | 41 overlay_pref_names.push_back(proxy_config::prefs::kProxy); |
| 41 #endif | 42 #endif |
| 42 return pref_service->CreateIncognitoPrefService( | 43 return pref_service->CreateIncognitoPrefService( |
| 43 incognito_extension_pref_store, overlay_pref_names); | 44 incognito_extension_pref_store, overlay_pref_names); |
| 44 } | 45 } |
| OLD | NEW |