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 "ios/chrome/browser/prefs/ios_chrome_pref_service_factory.h" | 5 #include "ios/chrome/browser/prefs/ios_chrome_pref_service_factory.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 // the preference store however since Chrome on iOS does not need to track | 61 // the preference store however since Chrome on iOS does not need to track |
62 // preference modifications (as applications are sand-boxed), it can use a | 62 // preference modifications (as applications are sand-boxed), it can use a |
63 // simple JsonPrefStore to store them (which is what PrefStoreManager uses | 63 // simple JsonPrefStore to store them (which is what PrefStoreManager uses |
64 // on platforms that do not track preference modifications). | 64 // on platforms that do not track preference modifications). |
65 syncable_prefs::PrefServiceSyncableFactory factory; | 65 syncable_prefs::PrefServiceSyncableFactory factory; |
66 PrepareFactory(&factory, browser_state_path.Append(kPreferencesFilename), | 66 PrepareFactory(&factory, browser_state_path.Append(kPreferencesFilename), |
67 pref_io_task_runner); | 67 pref_io_task_runner); |
68 scoped_ptr<syncable_prefs::PrefServiceSyncable> pref_service = | 68 scoped_ptr<syncable_prefs::PrefServiceSyncable> pref_service = |
69 factory.CreateSyncable(pref_registry.get()); | 69 factory.CreateSyncable(pref_registry.get()); |
70 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get()); | 70 ConfigureDefaultSearchPrefMigrationToDictionaryValue(pref_service.get()); |
71 return pref_service.Pass(); | 71 return pref_service; |
72 } | 72 } |
73 | 73 |
74 scoped_ptr<syncable_prefs::PrefServiceSyncable> | 74 scoped_ptr<syncable_prefs::PrefServiceSyncable> |
75 CreateIncognitoBrowserStatePrefs( | 75 CreateIncognitoBrowserStatePrefs( |
76 syncable_prefs::PrefServiceSyncable* pref_service) { | 76 syncable_prefs::PrefServiceSyncable* pref_service) { |
77 // List of keys that cannot be changed in the user prefs file by the incognito | 77 // List of keys that cannot be changed in the user prefs file by the incognito |
78 // browser state. All preferences that store information about the browsing | 78 // browser state. All preferences that store information about the browsing |
79 // history or behaviour of the user should have this property. | 79 // history or behaviour of the user should have this property. |
80 std::vector<const char*> overlay_pref_names; | 80 std::vector<const char*> overlay_pref_names; |
81 overlay_pref_names.push_back(proxy_config::prefs::kProxy); | 81 overlay_pref_names.push_back(proxy_config::prefs::kProxy); |
82 return make_scoped_ptr(pref_service->CreateIncognitoPrefService( | 82 return make_scoped_ptr(pref_service->CreateIncognitoPrefService( |
83 nullptr, // incognito_extension_pref_store | 83 nullptr, // incognito_extension_pref_store |
84 overlay_pref_names)); | 84 overlay_pref_names)); |
85 } | 85 } |
OLD | NEW |