| 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_command_line_pref_store.h> | 5 #include <chrome/browser/prefs/chrome_command_line_pref_store.h> |
| 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" | 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "components/signin/core/common/signin_pref_names.h" | 52 #include "components/signin/core/common/signin_pref_names.h" |
| 53 #include "components/sync/base/model_type.h" | 53 #include "components/sync/base/model_type.h" |
| 54 #include "components/sync/base/pref_names.h" | 54 #include "components/sync/base/pref_names.h" |
| 55 #include "components/sync_preferences/pref_model_associator.h" | 55 #include "components/sync_preferences/pref_model_associator.h" |
| 56 #include "components/sync_preferences/pref_service_syncable.h" | 56 #include "components/sync_preferences/pref_service_syncable.h" |
| 57 #include "components/sync_preferences/pref_service_syncable_factory.h" | 57 #include "components/sync_preferences/pref_service_syncable_factory.h" |
| 58 #include "components/user_prefs/tracked/pref_names.h" | 58 #include "components/user_prefs/tracked/pref_names.h" |
| 59 #include "content/public/browser/browser_context.h" | 59 #include "content/public/browser/browser_context.h" |
| 60 #include "content/public/browser/browser_thread.h" | 60 #include "content/public/browser/browser_thread.h" |
| 61 #include "extensions/features/features.h" | 61 #include "extensions/features/features.h" |
| 62 #include "rlz/features/features.h" |
| 62 #include "sql/error_delegate_util.h" | 63 #include "sql/error_delegate_util.h" |
| 63 #include "ui/base/resource/resource_bundle.h" | 64 #include "ui/base/resource/resource_bundle.h" |
| 64 | 65 |
| 65 #if BUILDFLAG(ENABLE_EXTENSIONS) | 66 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 66 #include "extensions/browser/pref_names.h" | 67 #include "extensions/browser/pref_names.h" |
| 67 #endif | 68 #endif |
| 68 | 69 |
| 69 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) | 70 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 70 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" | 71 #include "chrome/browser/supervised_user/supervised_user_pref_store.h" |
| 71 #endif | 72 #endif |
| 72 | 73 |
| 73 #if defined(OS_WIN) | 74 #if defined(OS_WIN) |
| 74 #include "base/win/win_util.h" | 75 #include "base/win/win_util.h" |
| 75 #if defined(ENABLE_RLZ) | 76 #if BUILDFLAG(ENABLE_RLZ) |
| 76 #include "rlz/lib/machine_id.h" | 77 #include "rlz/lib/machine_id.h" |
| 77 #endif // defined(ENABLE_RLZ) | 78 #endif // BUILDFLAG(ENABLE_RLZ) |
| 78 #endif // defined(OS_WIN) | 79 #endif // defined(OS_WIN) |
| 79 | 80 |
| 80 using content::BrowserContext; | 81 using content::BrowserContext; |
| 81 using content::BrowserThread; | 82 using content::BrowserThread; |
| 82 | 83 |
| 83 namespace { | 84 namespace { |
| 84 | 85 |
| 85 #if defined(OS_WIN) | 86 #if defined(OS_WIN) |
| 86 // Whether we are in testing mode; can be enabled via | 87 // Whether we are in testing mode; can be enabled via |
| 87 // DisableDomainCheckForTesting(). Forces startup checks to ignore the presence | 88 // DisableDomainCheckForTesting(). Forces startup checks to ignore the presence |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 error != PersistentPrefStore::PREF_READ_ERROR_NO_FILE) { | 393 error != PersistentPrefStore::PREF_READ_ERROR_NO_FILE) { |
| 393 LOG(ERROR) << "An error happened during prefs loading: " << error; | 394 LOG(ERROR) << "An error happened during prefs loading: " << error; |
| 394 } | 395 } |
| 395 #endif | 396 #endif |
| 396 } | 397 } |
| 397 } | 398 } |
| 398 | 399 |
| 399 std::unique_ptr<ProfilePrefStoreManager> CreateProfilePrefStoreManager( | 400 std::unique_ptr<ProfilePrefStoreManager> CreateProfilePrefStoreManager( |
| 400 const base::FilePath& profile_path) { | 401 const base::FilePath& profile_path) { |
| 401 std::string device_id; | 402 std::string device_id; |
| 402 #if defined(OS_WIN) && defined(ENABLE_RLZ) | 403 #if defined(OS_WIN) && BUILDFLAG(ENABLE_RLZ) |
| 403 // This is used by | 404 // This is used by |
| 404 // chrome/browser/extensions/api/music_manager_private/device_id_win.cc | 405 // chrome/browser/extensions/api/music_manager_private/device_id_win.cc |
| 405 // but that API is private (http://crbug.com/276485) and other platforms are | 406 // but that API is private (http://crbug.com/276485) and other platforms are |
| 406 // not available synchronously. | 407 // not available synchronously. |
| 407 // As part of improving pref metrics on other platforms we may want to find | 408 // As part of improving pref metrics on other platforms we may want to find |
| 408 // ways to defer preference loading until the device ID can be used. | 409 // ways to defer preference loading until the device ID can be used. |
| 409 rlz_lib::GetMachineId(&device_id); | 410 rlz_lib::GetMachineId(&device_id); |
| 410 #endif | 411 #endif |
| 411 std::string seed; | 412 std::string seed; |
| 412 #if defined(GOOGLE_CHROME_BUILD) | 413 #if defined(GOOGLE_CHROME_BUILD) |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 541 | 542 |
| 542 void ClearResetTime(Profile* profile) { | 543 void ClearResetTime(Profile* profile) { |
| 543 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); | 544 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); |
| 544 } | 545 } |
| 545 | 546 |
| 546 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 547 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 547 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 548 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 548 } | 549 } |
| 549 | 550 |
| 550 } // namespace chrome_prefs | 551 } // namespace chrome_prefs |
| OLD | NEW |