| 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 <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 DCHECK(!created_local_state_ && local_state_.get() == NULL); | 856 DCHECK(!created_local_state_ && local_state_.get() == NULL); |
| 857 created_local_state_ = true; | 857 created_local_state_ = true; |
| 858 | 858 |
| 859 base::FilePath local_state_path; | 859 base::FilePath local_state_path; |
| 860 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); | 860 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); |
| 861 scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; | 861 scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; |
| 862 | 862 |
| 863 // Register local state preferences. | 863 // Register local state preferences. |
| 864 chrome::RegisterLocalState(pref_registry.get()); | 864 chrome::RegisterLocalState(pref_registry.get()); |
| 865 | 865 |
| 866 local_state_.reset( | 866 local_state_ = |
| 867 chrome_prefs::CreateLocalState(local_state_path, | 867 chrome_prefs::CreateLocalState(local_state_path, |
| 868 local_state_task_runner_.get(), | 868 local_state_task_runner_.get(), |
| 869 policy_service(), | 869 policy_service(), |
| 870 pref_registry, | 870 pref_registry, |
| 871 false)); | 871 false).Pass(); |
| 872 | 872 |
| 873 pref_change_registrar_.Init(local_state_.get()); | 873 pref_change_registrar_.Init(local_state_.get()); |
| 874 | 874 |
| 875 // Initialize the notification for the default browser setting policy. | 875 // Initialize the notification for the default browser setting policy. |
| 876 pref_change_registrar_.Add( | 876 pref_change_registrar_.Add( |
| 877 prefs::kDefaultBrowserSettingEnabled, | 877 prefs::kDefaultBrowserSettingEnabled, |
| 878 base::Bind(&BrowserProcessImpl::ApplyDefaultBrowserPolicy, | 878 base::Bind(&BrowserProcessImpl::ApplyDefaultBrowserPolicy, |
| 879 base::Unretained(this))); | 879 base::Unretained(this))); |
| 880 | 880 |
| 881 // This preference must be kept in sync with external values; update them | 881 // This preference must be kept in sync with external values; update them |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 void BrowserProcessImpl::OnAutoupdateTimer() { | 1100 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 1101 if (CanAutorestartForUpdate()) { | 1101 if (CanAutorestartForUpdate()) { |
| 1102 DLOG(WARNING) << "Detected update. Restarting browser."; | 1102 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 1103 RestartBackgroundInstance(); | 1103 RestartBackgroundInstance(); |
| 1104 } | 1104 } |
| 1105 } | 1105 } |
| 1106 | 1106 |
| 1107 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1107 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |