| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 // Initialize the prefs of the local state. | 809 // Initialize the prefs of the local state. |
| 810 browser::RegisterLocalState(local_state_.get()); | 810 browser::RegisterLocalState(local_state_.get()); |
| 811 | 811 |
| 812 pref_change_registrar_.Init(local_state_.get()); | 812 pref_change_registrar_.Init(local_state_.get()); |
| 813 | 813 |
| 814 print_job_manager_->InitOnUIThread(local_state_.get()); | 814 print_job_manager_->InitOnUIThread(local_state_.get()); |
| 815 | 815 |
| 816 // Initialize the notification for the default browser setting policy. | 816 // Initialize the notification for the default browser setting policy. |
| 817 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, | 817 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, |
| 818 false); | 818 false); |
| 819 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) | |
| 820 ApplyDefaultBrowserPolicy(); | |
| 821 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this); | 819 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this); |
| 822 | 820 |
| 823 // Initialize the preference for the plugin finder policy. | 821 // Initialize the preference for the plugin finder policy. |
| 824 // This preference is only needed on the IO thread so make it available there. | 822 // This preference is only needed on the IO thread so make it available there. |
| 825 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false); | 823 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false); |
| 826 plugin_finder_disabled_pref_.reset(new BooleanPrefMember); | 824 plugin_finder_disabled_pref_.reset(new BooleanPrefMember); |
| 827 plugin_finder_disabled_pref_->Init(prefs::kDisablePluginFinder, | 825 plugin_finder_disabled_pref_->Init(prefs::kDisablePluginFinder, |
| 828 local_state_.get(), NULL); | 826 local_state_.get(), NULL); |
| 829 plugin_finder_disabled_pref_->MoveToThread(BrowserThread::IO); | 827 plugin_finder_disabled_pref_->MoveToThread(BrowserThread::IO); |
| 830 | 828 |
| 831 // Another policy that needs to be defined before the net subsystem is | 829 // Another policy that needs to be defined before the net subsystem is |
| 832 // initialized is MaxConnectionsPerProxy so we do it here. | 830 // initialized is MaxConnectionsPerProxy so we do it here. |
| 833 local_state_->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy, | 831 local_state_->RegisterIntegerPref(prefs::kMaxConnectionsPerProxy, |
| 834 net::kDefaultMaxSocketsPerProxyServer); | 832 net::kDefaultMaxSocketsPerProxyServer); |
| 835 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy); | 833 int max_per_proxy = local_state_->GetInteger(prefs::kMaxConnectionsPerProxy); |
| 836 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( | 834 net::ClientSocketPoolManager::set_max_sockets_per_proxy_server( |
| 837 std::max(std::min(max_per_proxy, 99), | 835 std::max(std::min(max_per_proxy, 99), |
| 838 net::ClientSocketPoolManager::max_sockets_per_group())); | 836 net::ClientSocketPoolManager::max_sockets_per_group())); |
| 839 | 837 |
| 840 // This is observed by ChildProcessSecurityPolicy, which lives in content/ | 838 // This is observed by ChildProcessSecurityPolicy, which lives in content/ |
| 841 // though, so it can't register itself. | 839 // though, so it can't register itself. |
| 842 local_state_->RegisterListPref(prefs::kDisabledSchemes); | 840 local_state_->RegisterListPref(prefs::kDisabledSchemes); |
| 843 pref_change_registrar_.Add(prefs::kDisabledSchemes, this); | 841 pref_change_registrar_.Add(prefs::kDisabledSchemes, this); |
| 844 ApplyDisabledSchemesPolicy(); | 842 ApplyDisabledSchemesPolicy(); |
| 845 | 843 |
| 846 local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false); | 844 local_state_->RegisterBooleanPref(prefs::kAllowCrossOriginAuthPrompt, false); |
| 847 } | 845 } |
| 848 | 846 |
| 847 void BrowserProcessImpl::PreMainMessageLoopRun() { |
| 848 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) |
| 849 ApplyDefaultBrowserPolicy(); |
| 850 } |
| 851 |
| 849 void BrowserProcessImpl::CreateIconManager() { | 852 void BrowserProcessImpl::CreateIconManager() { |
| 850 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 853 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
| 851 created_icon_manager_ = true; | 854 created_icon_manager_ = true; |
| 852 icon_manager_.reset(new IconManager); | 855 icon_manager_.reset(new IconManager); |
| 853 } | 856 } |
| 854 | 857 |
| 855 void BrowserProcessImpl::CreateSidebarManager() { | 858 void BrowserProcessImpl::CreateSidebarManager() { |
| 856 DCHECK(sidebar_manager_.get() == NULL); | 859 DCHECK(sidebar_manager_.get() == NULL); |
| 857 created_sidebar_manager_ = true; | 860 created_sidebar_manager_ = true; |
| 858 sidebar_manager_ = new SidebarManager(); | 861 sidebar_manager_ = new SidebarManager(); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 } | 993 } |
| 991 | 994 |
| 992 void BrowserProcessImpl::OnAutoupdateTimer() { | 995 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 993 if (CanAutorestartForUpdate()) { | 996 if (CanAutorestartForUpdate()) { |
| 994 DLOG(WARNING) << "Detected update. Restarting browser."; | 997 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 995 RestartBackgroundInstance(); | 998 RestartBackgroundInstance(); |
| 996 } | 999 } |
| 997 } | 1000 } |
| 998 | 1001 |
| 999 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1002 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |