OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chrome_pref_service_factory.h" | 5 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 std::string device_id; | 345 std::string device_id; |
346 #if defined(OS_WIN) && defined(ENABLE_RLZ) | 346 #if defined(OS_WIN) && defined(ENABLE_RLZ) |
347 // This is used by | 347 // This is used by |
348 // chrome/browser/extensions/api/music_manager_private/device_id_win.cc | 348 // chrome/browser/extensions/api/music_manager_private/device_id_win.cc |
349 // but that API is private (http://crbug.com/276485) and other platforms are | 349 // but that API is private (http://crbug.com/276485) and other platforms are |
350 // not available synchronously. | 350 // not available synchronously. |
351 // As part of improving pref metrics on other platforms we may want to find | 351 // As part of improving pref metrics on other platforms we may want to find |
352 // ways to defer preference loading until the device ID can be used. | 352 // ways to defer preference loading until the device ID can be used. |
353 rlz_lib::GetMachineId(&device_id); | 353 rlz_lib::GetMachineId(&device_id); |
354 #endif | 354 #endif |
| 355 std::string seed; |
| 356 #if defined(GOOGLE_CHROME_BUILD) |
| 357 seed = ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 358 IDR_PREF_HASH_SEED_BIN).as_string(), |
| 359 #endif |
355 return make_scoped_ptr(new ProfilePrefStoreManager( | 360 return make_scoped_ptr(new ProfilePrefStoreManager( |
356 profile_path, | 361 profile_path, |
357 GetTrackingConfiguration(), | 362 GetTrackingConfiguration(), |
358 kTrackedPrefsReportingIDsCount, | 363 kTrackedPrefsReportingIDsCount, |
359 ResourceBundle::GetSharedInstance() | 364 seed, |
360 .GetRawDataResource(IDR_PREF_HASH_SEED_BIN) | |
361 .as_string(), | |
362 device_id, | 365 device_id, |
363 g_browser_process->local_state())); | 366 g_browser_process->local_state())); |
364 } | 367 } |
365 | 368 |
366 void PrepareFactory( | 369 void PrepareFactory( |
367 PrefServiceSyncableFactory* factory, | 370 PrefServiceSyncableFactory* factory, |
368 policy::PolicyService* policy_service, | 371 policy::PolicyService* policy_service, |
369 SupervisedUserSettingsService* supervised_user_settings, | 372 SupervisedUserSettingsService* supervised_user_settings, |
370 scoped_refptr<PersistentPrefStore> user_pref_store, | 373 scoped_refptr<PersistentPrefStore> user_pref_store, |
371 const scoped_refptr<PrefStore>& extension_prefs, | 374 const scoped_refptr<PrefStore>& extension_prefs, |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 | 514 |
512 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 515 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
513 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 516 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
514 } | 517 } |
515 | 518 |
516 void RegisterPrefs(PrefRegistrySimple* registry) { | 519 void RegisterPrefs(PrefRegistrySimple* registry) { |
517 ProfilePrefStoreManager::RegisterPrefs(registry); | 520 ProfilePrefStoreManager::RegisterPrefs(registry); |
518 } | 521 } |
519 | 522 |
520 } // namespace chrome_prefs | 523 } // namespace chrome_prefs |
OLD | NEW |