| 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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 profile_manager_.reset(new ProfileManager(user_data_dir)); | 795 profile_manager_.reset(new ProfileManager(user_data_dir)); |
| 796 } | 796 } |
| 797 | 797 |
| 798 void BrowserProcessImpl::CreateLocalState() { | 798 void BrowserProcessImpl::CreateLocalState() { |
| 799 DCHECK(!created_local_state_ && local_state_.get() == NULL); | 799 DCHECK(!created_local_state_ && local_state_.get() == NULL); |
| 800 created_local_state_ = true; | 800 created_local_state_ = true; |
| 801 | 801 |
| 802 base::FilePath local_state_path; | 802 base::FilePath local_state_path; |
| 803 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); | 803 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); |
| 804 scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; | 804 scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; |
| 805 |
| 806 // Register local state preferences. |
| 807 chrome::RegisterLocalState(pref_registry); |
| 808 |
| 805 local_state_.reset( | 809 local_state_.reset( |
| 806 chrome_prefs::CreateLocalState(local_state_path, | 810 chrome_prefs::CreateLocalState(local_state_path, |
| 807 local_state_task_runner_, | 811 local_state_task_runner_, |
| 808 policy_service(), | 812 policy_service(), |
| 809 NULL, | 813 NULL, |
| 810 pref_registry, | 814 pref_registry, |
| 811 false)); | 815 false)); |
| 812 | 816 |
| 813 // Initialize the prefs of the local state. | |
| 814 // | |
| 815 // TODO(joi): Once we clean up so none of the registration methods | |
| 816 // need the PrefService pointer, this should happen before the call | |
| 817 // to CreateLocalState. | |
| 818 chrome::RegisterLocalState(local_state_.get(), pref_registry); | |
| 819 | |
| 820 pref_change_registrar_.Init(local_state_.get()); | 817 pref_change_registrar_.Init(local_state_.get()); |
| 821 | 818 |
| 822 // Initialize the notification for the default browser setting policy. | 819 // Initialize the notification for the default browser setting policy. |
| 823 pref_change_registrar_.Add( | 820 pref_change_registrar_.Add( |
| 824 prefs::kDefaultBrowserSettingEnabled, | 821 prefs::kDefaultBrowserSettingEnabled, |
| 825 base::Bind(&BrowserProcessImpl::ApplyDefaultBrowserPolicy, | 822 base::Bind(&BrowserProcessImpl::ApplyDefaultBrowserPolicy, |
| 826 base::Unretained(this))); | 823 base::Unretained(this))); |
| 827 | 824 |
| 828 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy); | 825 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy); |
| 829 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( | 826 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1033 } | 1030 } |
| 1034 | 1031 |
| 1035 void BrowserProcessImpl::OnAutoupdateTimer() { | 1032 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1036 if (CanAutorestartForUpdate()) { | 1033 if (CanAutorestartForUpdate()) { |
| 1037 DLOG(WARNING) << "Detected update. Restarting browser."; | 1034 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1038 RestartBackgroundInstance(); | 1035 RestartBackgroundInstance(); |
| 1039 } | 1036 } |
| 1040 } | 1037 } |
| 1041 | 1038 |
| 1042 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1039 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |