| 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_pref_service_factory.h" | 6 #include "chrome/browser/prefs/chrome_pref_service_factory.h" |
| 6 | 7 |
| 7 #include <stddef.h> | 8 #include <stddef.h> |
| 8 | 9 |
| 9 #include <string> | 10 #include <string> |
| 10 #include <vector> | 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/bind.h" | 13 #include "base/bind.h" |
| 13 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 14 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" | 16 #include "base/macros.h" |
| 16 #include "base/memory/ptr_util.h" | 17 #include "base/memory/ptr_util.h" |
| 17 #include "base/metrics/field_trial.h" | 18 #include "base/metrics/field_trial.h" |
| 18 #include "base/metrics/histogram_macros.h" | 19 #include "base/metrics/histogram_macros.h" |
| 19 #include "base/threading/sequenced_worker_pool.h" | 20 #include "base/threading/sequenced_worker_pool.h" |
| 20 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 21 #include "base/trace_event/trace_event.h" | 22 #include "base/trace_event/trace_event.h" |
| 22 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 23 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 24 #include "chrome/browser/prefs/chrome_pref_model_associator_client.h" | 25 #include "chrome/browser/prefs/chrome_pref_model_associator_client.h" |
| 25 #include "chrome/browser/prefs/command_line_pref_store.h" | |
| 26 #include "chrome/browser/prefs/profile_pref_store_manager.h" | 26 #include "chrome/browser/prefs/profile_pref_store_manager.h" |
| 27 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
| 28 #include "chrome/browser/sync/glue/sync_start_util.h" | 28 #include "chrome/browser/sync/glue/sync_start_util.h" |
| 29 #include "chrome/browser/ui/profile_error_dialog.h" | 29 #include "chrome/browser/ui/profile_error_dialog.h" |
| 30 #include "chrome/common/chrome_constants.h" | 30 #include "chrome/common/chrome_constants.h" |
| 31 #include "chrome/common/pref_names.h" | 31 #include "chrome/common/pref_names.h" |
| 32 #include "chrome/grit/browser_resources.h" | 32 #include "chrome/grit/browser_resources.h" |
| 33 #include "chrome/grit/chromium_strings.h" | 33 #include "chrome/grit/chromium_strings.h" |
| 34 #include "chrome/grit/generated_resources.h" | 34 #include "chrome/grit/generated_resources.h" |
| 35 #include "components/component_updater/pref_names.h" | 35 #include "components/component_updater/pref_names.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 scoped_refptr<PrefStore> supervised_user_prefs = make_scoped_refptr( | 433 scoped_refptr<PrefStore> supervised_user_prefs = make_scoped_refptr( |
| 434 new SupervisedUserPrefStore(supervised_user_settings)); | 434 new SupervisedUserPrefStore(supervised_user_settings)); |
| 435 DCHECK(async || supervised_user_prefs->IsInitializationComplete()); | 435 DCHECK(async || supervised_user_prefs->IsInitializationComplete()); |
| 436 factory->set_supervised_user_prefs(supervised_user_prefs); | 436 factory->set_supervised_user_prefs(supervised_user_prefs); |
| 437 } | 437 } |
| 438 #endif | 438 #endif |
| 439 | 439 |
| 440 factory->set_async(async); | 440 factory->set_async(async); |
| 441 factory->set_extension_prefs(extension_prefs); | 441 factory->set_extension_prefs(extension_prefs); |
| 442 factory->set_command_line_prefs(make_scoped_refptr( | 442 factory->set_command_line_prefs(make_scoped_refptr( |
| 443 new CommandLinePrefStore(base::CommandLine::ForCurrentProcess()))); | 443 new ChromeCommandLinePrefStore(base::CommandLine::ForCurrentProcess()))); |
| 444 factory->set_read_error_callback(base::Bind(&HandleReadError, pref_filename)); | 444 factory->set_read_error_callback(base::Bind(&HandleReadError, pref_filename)); |
| 445 factory->set_user_prefs(user_pref_store); | 445 factory->set_user_prefs(user_pref_store); |
| 446 factory->SetPrefModelAssociatorClient( | 446 factory->SetPrefModelAssociatorClient( |
| 447 ChromePrefModelAssociatorClient::GetInstance()); | 447 ChromePrefModelAssociatorClient::GetInstance()); |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace | 450 } // namespace |
| 451 | 451 |
| 452 namespace chrome_prefs { | 452 namespace chrome_prefs { |
| 453 | 453 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 void ClearResetTime(Profile* profile) { | 540 void ClearResetTime(Profile* profile) { |
| 541 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); | 541 ProfilePrefStoreManager::ClearResetTime(profile->GetPrefs()); |
| 542 } | 542 } |
| 543 | 543 |
| 544 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 544 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 545 ProfilePrefStoreManager::RegisterProfilePrefs(registry); | 545 ProfilePrefStoreManager::RegisterProfilePrefs(registry); |
| 546 } | 546 } |
| 547 | 547 |
| 548 } // namespace chrome_prefs | 548 } // namespace chrome_prefs |
| OLD | NEW |